semvec/pypi-packages huggingface dataset:
symgt 0.0.18
A package for group testing against symmetric distributions.
Requires Python: >=3.7

# symgt

A package for group testing against symmetric distributions. Python 3.

```bash
pip install symgt
```

For example, to compute an optimal partition for a symmetric distribution...
```python
import numpy as np
from symgt import models, algorithms, utils

# the representation alpha of symmetric distribution
alpha = np.array([0.5, 0.2, 0.0, 0.0, 0.0, 0.0, 0.2, 0.1, 0.0, 0.0, 0.0])
m = models.ExchangeableModel(10, alpha)
q = np.exp(m.log_q()) # the representation q of the symmetric distribution
multfn, cost = algorithms.symmetric_multfn(q) # cost is 6
intpart = utils.intpart_from_multfn(multfn) # intpart is [10]

# which differs from that computed using the IID approximation
m_iid = models.IIDModel(10, m.prevalence())
multfn_iid, _ = algorithms.symmetric_multfn(np.exp(m_iid.log_q()))
intpart_iid = utils.intpart_from_multfn(multfn_iid) # is [4, 3, 3]

utils.ECost(q, multfn) # 6
utils.ECost(q, multfn_iid) # 6.63
```
rbac-utils 1.0.1
Utilities for RBAC system

# SETUP

## INSTALLATION
Run this command to install the package `pip install rbac-utils==1.0.0 -i http://3.110.83.156:3141/dev/ldc_packages --trusted-host 3.110.83.156`

## USAGE
1. Install the library in your project using the above command.
2. Create the `rbac_utils.env` file in your project root (keys below).
3. import the main `Utils` class from lib to your code `from rbac_utils.utils import Utils` (I recommend renaming the import to `RbacUtils` this way `from rbac_utils.utils import Utils as RbacUtils`) 
4. Start using the utils functions on the class
	> `RbacUtils.generate_user_tokens('usr_id', {'key': 'value'})`


#### rbac_utils.env keys
1. RBAC_API_KEY='SECRET_KEY_OBTAINED_FROM_PERIPHERALS_TEAM'
2. RBAC_BASE_URL='https://qa-rbac.lendenclub.com'


# Docs

## RbacUtils.generate_user_tokens(user_id, data)

Generate user tokens (access token and refresh token) for the given user_id.

**Args:**
user_id (str): The identifier of the user for whom tokens are generated.
data (dict): A dictionary containing custom key-value pairs. 
				This dictionary is added as a value to the data key of the token.

**Returns:**
dict: A dictionary containing the generated access token and refresh token.
	An empty dictionary is returned if the generation process fails.




## RbacUtils.validate_access_token(access_token)

Validate an access token and retrieve user details.

**Args:**
access_token (str): The access token to be validated.

**Returns:**
dict: A dictionary containing user details if the token is valid.
	An empty dictionary is returned if validation fails.




## RbacUtils.refresh_user_tokens(refresh_token)

Refresh user tokens using a refresh token.

**Args:**
refresh_token (str): The refresh token used to obtain new tokens.

**Returns:**
dict: A dictionary containing the new access token and refresh token.
	An empty dictionary is returned if token refresh fails.




## RbacUtils.revoke_user_tokens(access_token, refresh_token)

Revoke user tokens.

**Args:**
access_token (str): The access token to be revoked.
refresh_token (str): The refresh token to be revoked.

**Returns:**
bool: True if the tokens were successfully revoked, False otherwise.




## RbacUtils.update_token_data(access_token, data)

Update a user's access token with new data.
NOTE: The existing access token will be invalidated after the update and the newly returned one takes its place.

**Args:**
access_token (str): The access token to be updated.
data (dict): New data to be added to the access token.

**Returns:**
str: The updated access token with the new data.
	None is returned if the update fails.




## RbacUtils.extract_token_claims(token)

Extract token claims.

**Args:**
token (str): The JWT from which claims will be extracted.

**Returns:**
dict: A dictionary containing the claims from the JWT.
	An empty dictionary is returned if decoding fails.
streamlit-flow-node-graph 0.0.10
Streamlit component that allows you to do X
Requires Python: >=3.7



# Usage

## Installation

`pip install streamlit-flow-node-graph`

## Create a graph element

```

# define items the user can use
item_types = [
        {"title":'Test 1',"color":"rgb(255,0, 192)", "port_selection" : 'out'},
        {"title":'Test 2',"color":"rgb(255, 0, 192)", "port_selection" : 'in'},
        {"title":'Test 3',"color":"rgb(0,255, 192)", "port_selection" : 'both'},
    ]

diagram = node_graph.node_graph(model=model, item_types=item_types, key='test' )
st.write(diagram.selected) # access currently selected node id
st.write(diagram.model) # access the underlysing model
```

## Features

 - specify a node icon with the icon property e.g. ` {"title":'Purchase',"color":"rgb(255,0, 192)", "port_selection" : 'out', "icon" : 'shopping-cart'}` (icons in the font-awesome collection can be used)
 - use diagram utils
 ```
diagram = node_graph.node_graph(model=model, item_types=item_types, key='`test`' )
digram.get_selected_node()
diagram.get_all_nodes_node_inputs()
formated_nodes, formated_links = diagram.process_diagram_output()
```

# Contribute

## Start dev 
`cd node_graph/frontend && npm install && npm run start`

uncomment `# _RELEASE = True` in `node_graph/__init__.py` and in another shell
`streamlit run node_graph/__init__.py `

## Build
`cd node_graph/frontend && npm build`
`cd../..`
`rm -rf dist/*`
`python setup.py sdist bdist_wheel`

## Upload
1. Change version in `setup.py`
2. `twine upload dist/*`

# Developer

## Deployment 

https://docs.streamlit.io/library/components/publish

python setup.py sdist bdist_wheel

python -m twine upload dist/*