semvec/pypi-packages huggingface dataset:
idun_mock 0.1.5
Mock a real IDUN Guardian device for testing purposes
Requires Python: >=3.10,<4.0

# IDUN Guardian mock library / client

This is a client library for the IDUN Guardian which mocks out the physical device, intended for development and building tests for the IDUN Guardian.
The [`data_generator`](idun_mock/data_generator) generates random device packets.
The [`client`](idun_mock/client) is a command-line utility that sends them to the Guardian API.

## Features

- Mock device data generator
- Send mocked device data to a Cloud endpoint

## Sending mock data to the cloud API (client)

You can start sending mock data to the cloud API by installing the poetry project and running the `idun_mock.client` module:

```
# at this directory
poetry install
poetry run python -m idun_mock.client -w <websocket_url>
```

The websocket URL is where the data should be sent. Change the generator parameters according to what scenario you want to simulate (look in [`idun_mock/client/__main__.py`](idun_mock/client/__main__.py)).

## Troubleshooting: sending mock data to Kinesis, bypassing the API

If you have IDUN AWS credentials, you can also send mock data directly to Kinesis, bypassing the API:

```
# Set these environment variables:
#   AWS_ACCESS_KEY_ID
#   AWS_SECRET_ACCESS_KEY
#   AWS_DEFAULT_REGION

poetry run python -m idun_mock.client -k <kinesis_stream_name> [-e <aws_endpoint>]
```
resoto-plugin-cleanup-expired 3.7.0
Resoto Expired Resource Cleanup Plugin
Requires Python: >=3.9

# resoto-plugin-cleanup-expired
Resoto plugin for cleanup of expired resources

This plugin looks for resources with the tags `expiration` or `resoto:expires` and flags them for cleanup if they are expired.

## Tag format

| Tag              | Format                      | Description                                          |
| ---------------- | --------------------------- | ---------------------------------------------------- |
| `resoto:expires` | `2019-09-05T10:40:11+00:00` | ISO 8601 Timestamp                                   |
| `expiration`     | `24h`                       | A timedelta relative to the resource's creation time |

Example of valid units for the `expiration` tag:

```
weeks
days
hours
minutes
```

Each of them can be abbreviated down to one letter. E.g. `7d`, `24h`, `60m`, etc. A space in between the numeric and the unit is optional, meaning `7d` and `7 days` are equivalent.

## Usage

In `resh` execute

```
> config edit resoto.worker
```

and find the following section

```
plugin_cleanup_expired:
  # Enable plugin?
  enabled: false
```
resoto-plugin-cleanup-untagged 3.7.0
Resoto Cleanup Untagged Plugin
Requires Python: >=3.9

# resoto-plugin-cleanup-untagged
Cleanup Untagged Plugin for Resoto

This plugin deletes cloud resources that are missing mandatory tags after a certain amount of time has passed since their creation.

## Usage

In `resh` execute

```
> config edit resoto.worker
```

and find the following section

```
plugin_cleanup_untagged:
  # Configuration for the plugin
  config:
    default:
      age: '2h'
    tags:
      - 'owner'
      - 'expiration'
    kinds:
      - 'aws_ec2_instance'
      - 'aws_ec2_volume'
      - 'aws_vpc'
      - 'aws_cloudformation_stack'
      - 'aws_elb'
      - 'aws_alb'
      - 'aws_alb_target_group'
      - 'aws_eks_cluster'
      - 'aws_eks_nodegroup'
      - 'example_instance'
      - 'example_network'
    accounts:
      aws:
        068564737731:
          name: 'playground'
          age: '7d'
        '575584959047':
          name: 'eng-sre'
      example:
        Example Account:
          name: 'Example Account'
  # Enable plugin?
  enabled: false
```

### Config section format

The config section consists of four sub-sections. `default`, `tags`, `classes` and `accounts`. The `default` section specifies the default `age` a resource must have before we enforce mandatory tags on it. For instance if `age` is set to `2h` this means that whatever mechanism creates a resource has two hours to add those mandatory tags.

The `tags` section is a list of tag names that MUST exist on every resource class specified in `classes`. The `classes` section is a list of resource class names for which tags specified in the `tags` list must exist.

The `accounts` section contains a dictionary with cloud IDs as keys (e.g. `aws`) and account IDs for which tags will be enforced as values (e.g. `068564737731`). Those in turn contain a `name` and optionally an `age` override.

The following age units are valid:

```
weeks
days
hours
minutes
```

Each of them can be abbreviated down to one letter. E.g. `7d`, `24h`, `60m`, etc. A space in between the numeric and the unit is optional, meaning `7d` and `7 days` are equivalent.
resoto-plugin-cleanup-aws-vpcs 3.7.0
AWS VPC Cleaner Plugin
Requires Python: >=3.9

# resoto-plugin-cleanup-aws-vpcs
AWS VPC Cleanup Plugin for Resoto

This plugin marks all VPC dependencies for cleanup. The VPC must have been previously marked for cleanup by another cleanup plugin.

The following resources are currently being marked for cleanup

- AWS VPC Peering Connections
- AWS EC2 Network ACLs
- AWS EC2 Network Interfaces
- AWS ELB
- AWS ALB
- AWS ALB Target Groups
- AWS EC2 Subnets
- AWS EC2 Security Groups
- AWS EC2 Internet Gateways
- AWS EC2 NAT Gateways
- AWS EC2 Route Tables

## Usage

In `resh` execute

```
> config edit resoto.worker
```

and find the following section

```
plugin_cleanup_aws_vpcs:
  # Dictionary of key cloud with list of account IDs for which the plugin should be active as value
  config:
    aws:
      - '1234567'
      - '567890'
  # Enable plugin?
  enabled: false
```
resoto-plugin-cleanup-aws-loadbalancers 3.7.0
AWS Loadbalancers Cleaner Plugin
Requires Python: >=3.9

# resoto-plugin-cleanup-aws-loadbalancers
AWS Loadbalancers Cleanup Plugin for Resoto

This plugin cleans up AWS ALB/ELB load balancers with no instances attached to them.

## Usage

```
plugin_cleanup_aws_loadbalancers:
  # Enable plugin?
  enabled: false
  # Minimum age of unused load balancers to cleanup
  min_age: '7 days'
```

The default load balancer age is 7 days. Meaning if a load balancer is more than 7 days old and does not have any instances/backends attached it will be flagged for cleanup.

Optionally change the age cutoff value using the `min_age` option.

Example of valid age units:

```
weeks
days
hours
minutes
```

Each of them can be abbreviated down to one letter. E.g. `7d`, `24h`, `60m`, etc. A space in between the numeric and the unit is optional, meaning `7d` and `7 days` are equivalent.
resoto-plugin-tagvalidator 3.7.0
Resoto Tag Validator Plugin
Requires Python: >=3.9

# resoto-plugin-tagvalidator
Tag Validator plugin for Resoto

This plugin validates the contents of expiration tags. With it you can enforce a max. expiration length for certain resources in an account. For instance you could have an org policy that says in our "dev" account compute instances are only allowed to exist for 2 days max. Then this plugin can ensure that the expiration tag on those instances is set to no more than 2 days. If it is set to e.g. 50h it would be corrected down to 48h.

## Usage

In `resh` execute

```
> config edit resoto.worker
```

and find the following section

```
plugin_tagvalidator:
  # Configuration for the plugin
  # See https://github.com/someengineering/resoto/tree/main/plugins/tagvalidator for syntax details
  config:
    default:
      expiration: '24h'
    kinds:
      - 'aws_ec2_instance'
      - 'aws_vpc'
      - 'aws_cloudformation_stack'
      - 'aws_elb'
      - 'aws_alb'
      - 'aws_alb_target_group'
      - 'aws_eks_cluster'
      - 'aws_eks_nodegroup'
      - 'aws_ec2_nat_gateway'
    accounts:
      aws:
        '123465706934':
          name: 'eng-audit'
        '123479172032':
          name: 'eng-devprod'
        '123453451782':
          name: 'sales-lead-gen'
          expiration: '12h'
        '123415487488':
          name: 'sales-hosted-lead-gen'
          expiration: '8d'
  # Dry run
  dry_run: false
  # Enable plugin?
  enabled: false
```

## Structure of the config section

The config contains a default section with the expiration that should be used for all accounts by default. The kinds section contains the list of kinds that these expiration tag rules apply to. The accounts section contain the cloud ids followed by the account ids. Each account id must contain a `name` and optionally an `expiration` that overwrites the global default.
resoto-plugin-cleanup-volumes 3.7.0
Volume Cleaner Plugin
Requires Python: >=3.9

# resoto-plugin-cleanup-volumes
Volume cleanup plugin for Resoto

This plugin cleans up storage volumes.

## Usage

In `resh` execute

```
> config edit resoto.worker
```

and find the following section

```
plugin_cleanup_volumes:
  # Enable plugin?
  enabled: false
  # Minimum age of unused volumes to cleanup
  min_age: '14 days'
```

The default volume age is 14 days. Meaning if a volume is not in use and has not had any read or write IOPS within the last 14 days it will be deleted.

Optionally change the age cutoff value using the `min_age` option.

Example of valid age units:

```
weeks
days
hours
minutes
```

Each of them can be abbreviated down to one letter. E.g. `7d`, `24h`, `60m`, etc. A space in between the numeric and the unit is optional, meaning `7d` and `7 days` are equivalent.
resoto-plugin-cleanup-aws-alarms 3.7.0
AWS Cloudwatch Alarms Cleaner Plugin
Requires Python: >=3.9

# resoto-plugin-cleanup-aws-alarms
AWS Cloudwatch Alarms Cleanup Plugin for Resoto

This plugin marks all orphaned AWS CloudWatch Instance Alarms for cleanup.

The following resources are currently being marked for cleanup

- Instance Alarms

## Usage

In `resh` execute

```
> config edit resoto.worker
```

and find the following section

```
plugin_cleanup_aws_alarms:
  # Dictionary of key cloud with list of account IDs for which the plugin should be active as value
  config:
    aws:
      - '1234567'
      - '567890'
  # Enable plugin?
  enabled: false
```
resoto-plugin-protector 3.7.0
Resoto Protector Plugin
Requires Python: >=3.9

# resoto-plugin-protector
Protector Plugin for Resoto

This plugin protects important resources from deletion by Resoto.

## Usage

In `resh` execute

```
> config edit resoto.worker
```

and find the following section

```
plugin_protector:
  # Configuration for the plugin
  # See https://github.com/someengineering/resoto/tree/main/plugins/protector for syntax details
  config:
    aws:
      '110465657741':
        us-east-1:
          aws_ec2_instance:
            - 'i-0fcbe8974615bfd37'
  # Enable plugin?
  enabled: false
```

The format of the `config` section is as follows:

```
cloud.id:
  account.id:
    region.id:
      kind:
        - resource.id
```

### Implementation details

Each Resoto resource has an attributed `/metadata.protected` which takes a boolean value. By default it is set to `false`. Each Resoto resource inherits BaseResource which contains two methods for cleaning up a resource, `cleanup()` and `delete()`. Both those methods will refuse to manipulate a resource once the `protected` attribute has been set to `true`. Meaning if a resource is marked as protected but has also been flagged for cleanup the cleanup will fail because protected resources cannot be deleted.
genser 1.0.1
A set of functions to transform datasets
Requires Python: >=3.6

The GenSer package (i.e. Generalised Serialisation) contains the set of functions to perform the dimension transformation of the numerical dataset. To use the package you should have a dataset of non-negative integer values. Having n features in your dataset, you may transform it to m features and, after your work with data, return back to n features. The following functions available:

dim_step_down(data, powers): 
    data is a list of lists; 
    powers is list of powers of the features, i.e. how many different values can the feature take.

dim_step_up(data, powers): 
    the same description as for dim_step_down.

transform_to(data, d): 
    Transforms the dimension of the given dataset to the d value
    
    Arguments:
    data (list of lists): the input dataset without labels
    d (int): the target dimension
    
    Outputs:
    A dataset of dimension d, 
    A list of transformation hints: a tuple (powers, tdict) for every step.

transform_out_down(data, rlist): 
    Transforms back the dimension of the given dataset 
    when the dimension had been increased by transform_to 
    
    Arguments:
    data (list of lists): the input dataset without labels
    rlist (list): the list resulted from transform_to
    
    Outputs:
    A restored dataset, 
    A powers of the restored dataset (may differ from the 
        initial powers of transform_to argument data).

transform_out_up(data, rlist): 
    Transforms back the dimension of the given dataset 
    when the dimension had been decreased by transform_to 
    
    Arguments:
    data (list of lists): the input dataset without labels
    rlist (list): the list resulted from transform_to
    
    Outputs:
    A restored dataset, 
    A powers of the restored dataset (may differ from the 
        initial powers of transform_to argument data). 


Additional information available directly from the author by request on email shoukhov@mail.ru
venv-test-wzc 1.0.2
a python package for ...
Keywords: python,venv_test_wzc


# venv_test_wzc

[![Downloads](https://static.pepy.tech/badge/dumb-menu)](https://pepy.tech/project/dumb-menu)

这是一个用验证PIPY上传及下载的工程


## Installation

```
pip install venv_test_wzc
```


## Usage

example:


another example:


## Get help


## Update log

`1.0.1` Secondary release

`1.0.0` first release

## how to upload a new version (for me)


> make sure have twine installed first

1. change `setup.py`
2. testing `python3 setup.py develop`
3. `python3 setup.py sdist`
4. `twine upload dist/*`
adash 1.5.0
Utility
Requires Python: >=3.8

ユーティリティライブラリ

[![Test](https://github.com/atu4403/adash/actions/workflows/test.yml/badge.svg)](https://github.com/atu4403/adash/actions/workflows/test.yml)
[![PyPI version](https://badge.fury.io/py/adash.svg)](https://badge.fury.io/py/adash)

## install

```bash
pip install adash
```

## useit

[Lodash](https://lodash.com/)のような使い方を推奨します。

```python
import adash as _

s = "abcabc"
obj = {"a": "!", "b": "", "c": "?"}
_.replace_all(s, obj) #-> !?!?
```

[adash API documentation](https://atu4403.github.io/adash/adash/)