semvec/pypi-packages huggingface dataset:
RandDist 0.0.6
A random number generator with custom probability distribution function
Requires Python: >=3.6

# RandDist

## python random generator with custom probability distribution

This minimal package generates a list of int or float numbers within a specific range and steps with custom probability distribution.

![myfile](https://raw.githubusercontent.com/BehrouzSohrabi/Random-with-custom-distribution/main/demo/animated_plot.gif)

## How to use

### install

`` pip install randdist``

### include

```python
import randdist
```

### generate

```python
numbers_list = randdist.randint(0, 10, formula = lambda x:x**2)
```

## Methods

* `randint`: Generates integer numbers
* `randfloat`: Generates float numbers

## Parameters

* `min_value`: start
* `max_value`: stop
* `step`: bin step size `default = 1`
* `formula`: lambda function for distribution curve `default = lambda x:x`
* `seeds`: # of generated numbers `default = 1000`
* `sample_size`: # of numbers to return `default = 0`
  - `0`: return a list of generated numbers.
  - `1`: return only one int or float number
  - `2 or more`: returns a list with the specified amount of numbers. sample_size can't be more than seeds.

## Outputs

Depending on `sample_size`:

* `list`: a list of shuffled generated numbers
  or
* `sample`: an integer of a float number from the list

## Demo

* `min_value = -3`
* `max_value = 3`
* `step = 0.5`
* `formula = lambda x:12-(x**2)`
* `seeds = 1000`

```python
# generate int numbers
random_list_int = randdist.randint(min_value, max_value, step, formula, seeds)

# generate float numbers
random_list_float = randdist.randfloat(min_value, max_value, step, formula, seeds)
```

![myfile](https://raw.githubusercontent.com/BehrouzSohrabi/Random-with-custom-distribution/main/demo/formula_plot.png)
![myfile](https://raw.githubusercontent.com/BehrouzSohrabi/Random-with-custom-distribution/main/demo/distribution_plot_int.png)
![myfile](https://raw.githubusercontent.com/BehrouzSohrabi/Random-with-custom-distribution/main/demo/distribution_plot_float.png)

### Test Distribution

with 10K generated numbers

```python
# pick samples from 10K generated list of numbers
generated_list = []
for i in range(10000):
    sample_int = randdist.randint(-3, 3, 0.5, lambda x:12-(x**2), sample_size = 1)
    generated_list.append(sample_int)
```

![myfile](https://raw.githubusercontent.com/BehrouzSohrabi/Random-with-custom-distribution/main/demo/distribution_plot_test.png)
alphaconfig 0.0.3
An easy module for configuration


# AlphaConfig

## Introduction

AlphaConfig is easy to read and easy to use, which is designed for configuration.

## Installation

You can install AlphaConfig by pip.

```
pip install AlphaConfig
```

## APIs

### __init__(src_dict: dict=None, path2yaml: os.PathLike=None, path2json: os.PathLike=None, read_only: bool=False, **kwargs)

```
Info:
    Initialize a AlphaConfig instance.
Args:
    src_dict (dict): Create an AlphaConfig instance from python builtin's dict, default is None.
    path2yaml (os.PathLike): Create an AlphaConfig instance from a yaml file, default is None.
    path2json (os.PathLike): Create an AlphaConfig instance from a json file, default is None.
    read_only (bool): Set the state of AlphaConfig instance, modification is allowed only if its value is False.
    kwargs (key-value pairs): Create attribute-value pairs from key-value pairs.
```

#### Example

```python
from alphaconfig import AlphaConfig
test_dict = {
    "attr_1": 1, 
    "attr_2": {
        "attr_2_1": [2, 3], 
        "attr_2_2": "this is attr_2_2", 
    }
}
configs = AlphaConfig(test_dict, attr_3="value_3")
print(configs)
# * ATTRIBUTES *
# - attr_1: 1
# - attr_2: 
#         - attr_2_1: [2, 3]
#         - attr_2_2: this is attr_2_2
# - attr_3: value_3
```

### is_read_only()

```
Info:
    Allow user to check whether an instance is read only or not.
Returns:
    (bool): True if it is read only else False.
```

### cvt2dict()

```
Info:
    Convert an AlphaConfig instance to a python builtin's dict.
Returns:
    (dict)
```

#### Examples

```python
test_dict = {
    "attr_1": 1, 
    "attr_2": {
        "attr_2_1": [2, 3], 
        "attr_2_2": "this is attr_2_2", 
    }
}
configs = AlphaConfig(test_dict, attr_3="value_3")
print(configs.cvt2dict())
# {'attr_1': 1, 'attr_2': {'attr_2_1': [2, 3], 'attr_2_2': 'this is attr_2_2'}, 'attr_3': 'value_3'}
```

### cvt_state(read_only: bool=None)

```
Info:
    Convert the readable state according to the given arg.
Args:
    read_only (bool): Set the readable state, if no value is given, revert the state.
Returns:
    (bool): The final readable state.
```

### keys()

```
Info:
    Get all user-defined attributes. This method act like a python builtin's dict.
Returns:
    (dict_keys)
```

### values()

```
Info:
    Get all user-defined values of corresponding keys. This method act like a python builtin's dict.
Returns:
    (dict_values)
```

### items()

```
Info:
    Get all user-defined values of corresponding keys. This method act like a python builtin's dict.
Returns:
    (dict_items)
```

### iter()

AlphaConfig supports `iter`.

#### Example

```python
test_dict = {
    "attr_1": 1, 
    "attr_2": {
        "attr_2_1": [2, 3], 
        "attr_2_2": "this is attr_2_2", 
    }
}
config = AlphaConfig(test_dict)
    for it in config:
        print(it)
# ('attr_1', 1)
# ('attr_2', {'attr_2_1': [2, 3], 'attr_2_2': 'this is attr_2_2'})
```

### copy and deepcopy

AlphaConfig supports copy and deepcopy, just call `copy` module.
torchFunctions 0.0.3
This package makes the ease of using code in pytorch which needs to be used multiple times
Requires Python: >=3.6

# torchFunctions - eleka12

A small package for pytorch functions

# How to use -

* install the latest package 

> * in jupyter notebook -
```
    !pip install torchFunctions
```

> * in command prompt -
```bash    
    pip install torchFunctions
```

* Now run below snippets of code in your jupyter-notebooks / python project to use pytorch defined functions

## default use case -
```python

from torchFunctions.parameters import parameters

model = "your model"

parameters().count_params( model )
```

## pypi repo link -

[torchFunctions](https://pypi.org/project/torchFunctions/)