semvec/pypi-packages huggingface dataset:
impartial 0.2.0
A lightweight extension of functools.partial
License: Apache-2.0
Requires Python: >=3.7,<4.0

# impartial

[![build](https://github.com/georg-wolflein/impartial/workflows/build/badge.svg)](https://github.com/georg-wolflein/impartial/actions?query=workflow%3Abuild)
[![PyPI](https://img.shields.io/pypi/v/impartial)](https://pypi.org/project/impartial)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/impartial)](https://pypi.org/project/impartial)
[![Licence](https://img.shields.io/github/license/georg-wolflein/impartial)](https://github.com/georg-wolflein/impartial/blob/master/LICENSE)

_impartial_ is a lightweight extension of [functools.partial](https://docs.python.org/3/library/functools.html#functools.partial) that allows modifying positional and keyword arguments in a functional style.

The main idea is that any function wrapped with `impartial` gets a method `with_<keyword>(value)` for every keyword argument of that function.
Each `with_<keyword>(value)` method returns a new `impartial` function with that keyword being modified.

```python
>>> from impartial import impartial
>>> @impartial
... def power(x, exponent):
...     return x ** exponent
...
>>> power
impartial(<function power at 0x10d54e790>)
>>> square = power.with_exponent(2) # behaves like functools.partial(square, exponent=2)
>>> square
impartial(<function power at 0x10d54e790>, exponent=2)
>>> square(3)
9
```

Features:

- the `with_<keyword>(value)` methods can be arbitrarily **chained**
- `impartial` functions are **immutable**: any "modification" of arguments returns a new `impartial` function
- very **lightweight** (~50 LOC and no dependencies)
- fully **compatible** with [functools.partial](https://docs.python.org/3/library/functools.html#functools.partial) (`impartial` is a subclass of `functools.partial`)
- can be used as a **decorator**

To install this package, run:

```
pip install impartial
```
pahud-cdktf-aws-eks 0.3.0
CDKTF construct library for Amazon EKS
License: Apache-2.0
Requires Python: >=3.6

[![npm version](https://badge.fury.io/js/@pahud%2Fcdktf-aws-eks.svg)](https://badge.fury.io/js/@pahud%2Fcdktf-aws-eks)
[![PyPI version](https://badge.fury.io/py/pahud-cdktf-aws-eks.svg)](https://badge.fury.io/py/pahud-cdktf-aws-eks)
[![release](https://github.com/pahud/cdktf-aws-eks/actions/workflows/release.yml/badge.svg)](https://github.com/pahud/cdktf-aws-eks/actions/workflows/release.yml)
[![construct hub](https://img.shields.io/badge/Construct%20Hub-available-blue)](https://constructs.dev/packages/@pahud/cdktf-aws-eks)

# cdktf-aws-eks

CDKTF construct library for Amazon EKS.

## Usage

The following sample creates:

1. A new VPC
2. Amazon EKS cluster(control plane)
3. The default nodegroup with the cluster
4. The 2nd nodegroup with spot instances

```python
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from pahud.cdktf_aws_eks import Cluster

# create the cluster and the default nodegroup
cluster = Cluster(stack, "demo-cluster",
    version=KubernetesVersion.V1_21,
    scaling_config={"min_capacity": 1}
)

# create the optional 2nd nodegroup
cluster.add_node_group("NG2",
    scaling_config={
        "min_capacity": 1,
        "max_capacity": 10,
        "desired_capacity": 5
    },
    capacity_type=CapacityType.SPOT,
    instance_types=["t3.large", "c5.large", "m5.large"]
)
```

## Existing VPC subnets

To deploy in any existing VPC, specify the `privateSubnets` and `publicSubnets`(if any).

```python
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
Cluster(stack, "demo-cluster",
    private_subnets=["subnet-111", "subnet-222", "subnet-333"],
    public_subnets=["subnet-444", "subnet-555", "subnet-666"],
    version=KubernetesVersion.V1_21
)
```