semvec/pypi-packages huggingface dataset:
age-verification-psehack 0.2.2
A Django middleware for verifying the user's age before allowing them access to resources
Requires Python: >=3.8

# Important. This project has not been finished. It does not have the intended integration with https://github.com/zk-passport/openpassport/tree/main/sdk due to some errors encountered when creating the browser bundle of the said sdk. 

A Django middleware for verifying the user's age before allowing them access to a resource.
Developed for the purposes of the PSE Hackathon held in Sep 2024.

The user is expected to own an Android or iOS device with an **NFC reader** and a compatible passport.

## Installation

- pip install age_verification_psehack

In your Django project's `settings.py`:

Add the following line to the bottom of the **MIDDLEWARE** section:

- "age_verification_psehack.middleware.AgeVerificationMiddleware"

Add the following line to the bottom of the **INSTALLED_APPS** section:

- "age_verification_psehack.apps.AgeVerificationPSEHackConfig"

Add a new **AGE_VERIFICATION_PATHS** setting containing all paths requiring age verification:

- AGE_VERIFICATION_PATHS = ['/protected_path1', '/protected/path2']

Usually all Django projects are already configured to serve static files. If yours is not configured,
consult https://docs.djangoproject.com/en/4.2/howto/static-files/

Navigate to the root of your Django project and run:

- python manage.py makemigrations age_verification_psehack
- python manage.py migrate
- python manage.py collectstatic



#### For developers only: testing local changes

In case if you need to make changes and test them, in the root of this repo run

- python -m pip install build
- python -m build

In the root of your Django project create a file `requirements.txt` with the following:

-e path/to/the/root/of/this/repo

Then run:

python -m pip install -r requirements.txt
multirepo-manager 1.0.1
CLI to manage multiple git repositories in the same folder

# Multirepository Manager
A CLI to perform simple git operation on multiple repository **at the same time**. The available commands are very limited, but they are the most common ones. The main goal of this project is to provide a simple way to manage multiple repositories at the same time, particularly useful if you are working on a multirepository project where all the involved distributions are installed in editable mode.

## Installation
To install the CLI, simply run the following command:

```
pip install multirepo-manager
```
## How to use it
1. Run the command you want to execute on all the repositories

Consider the following folder structure:

```
.
└── multirepo_project/
    ├── repo_1
    ├── repo_2
    └── repo_3
```
### Setup 
The first step is to set the path to the folder containing the involved repositories. 

This can be done either by:

1. Setting the env variable `REPOS_FOLDER`
1. Running the CLI command `multirepo set-folder /foo/bar/multirepo_project`

### Commands
Once the path is set, simply type `multirepo` on your command prompt to have a list of the available commands.


```> multirepo
Usage: multirepo [OPTIONS] COMMAND [ARGS]...

  CLI commands for simple git operation on multiple repositories in the same
  folder

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  fetch       Fetch all the repositories in the folder
  pull        Pull changes from all the repositories in the folder
  push        Push commits to all the repositories in the folder
  set-folder  Set the folder path containing the repositories
  switch      Switch to a branch (create it if does not exists) in all...
```
FixedPointJAX 0.0.25
Fixed-point iterations for root finding implemented in JAX
Requires Python: >=3.6

# Fixed-point solver
FixedPointJAX is a simple implementation of a fixed-point iteration algorithm for root finding in JAX.

* Strives to be minimal
* Has no dependencies other than JAX

## Installation

```bash
pip install FixedPointJAX
```

## Usage

```python

import jax.numpy as jnp
from jax import random

from FixedPointJAX import FixedPointRoot

# Define the logit probabilities
def my_logit(x, axis=0):
	nominator = jnp.exp(x - jnp.max(x, axis=axis, keepdims=True))
	denominator = jnp.sum(nominator, axis=axis, keepdims=True)
	return nominator / denominator
	
# Define the function for the fixed-point iteration
def my_fxp(x,s0):
	s = my_logit(x)
	z = jnp.log(s0 / s)
	return x + z, z
print('-----------------------------------------')
# Dimensions of system of fixed-point equations
shape = (3, 4)

# Simulate probabilities
s0 = my_logit(random.uniform(key=random.PRNGKey(123), shape=shape))

# Set up fixed-point equation
fun = lambda x: my_fxp(x,s0)

# Initial guess
x0 = jnp.zeros_like(s0)

# Solve the fixed-point equation
x, (step_norm, root_norm, iterations) = FixedPointRoot(fun, x0)
print('-----------------------------------------')
print(f'System of fixed-point equations is solved: {jnp.allclose(x,fun(x)[0])}.')
print(f'Probabilities are identical: {jnp.allclose(s0, my_logit(x))}.')
print('-----------------------------------------')
```