semvec/pypi-packages huggingface dataset:
lensed-umap 0.1.3
Untangle UMAP with filters.
Requires Python: >=3.10
Keywords: umap, dimensionality reduction, data visualization

[![PyPI version](https://badge.fury.io/py/lensed-umap.svg)](https://badge.fury.io/py/lensed-umap)
[![Tests](https://github.com/vda-lab/lensed_umap/actions/workflows/Tests.yml/badge.svg)](https://github.com/vda-lab/lensed_umap/actions/workflows/Tests.yml)
[![Repository DOI](https://zenodo.org/badge/706249828.svg)](https://zenodo.org/doi/10.5281/zenodo.11193167)

# Lensed UMAP

Lensed UMAP provides three methods that apply lens-functions to a UMAP model.
Lens functions can be used to untangle embeddings along a particular dimension.
This dimension may be part of the data, or come from another information source.
Using lens functions, analysts can update their UMAP models to the questions
they are investigating, effectively viewing their data from different
perspectives. 

## How to use Lensed UMAP

The lensed UMAP package provides functions that operate on (fitted) UMAP
objects.

```python
import numpy as np
import pandas as pd
from umap import UMAP
import lensed_umap as lu
import matplotlib.pyplot as plt

# Load data and extract lens
df = pd.read_csv("./data/five_circles.csv", header=0)
lens = np.log(df.hue)

# Compute initial UMAP model
projector = UMAP(
    repulsion_strength=0.1,  # To avoid tears in projection that
    negative_sample_rate=2,  # are not in the modelled graph!
).fit(df[["x", "y"]])

# Draw intial model
x, y = lu.extract_embedding(projector)
plt.scatter(x, y, 2, lens, cmap="viridis")
plt.axis("off")
plt.show()
```

![Initial UMAP model](docs/_static/initial_umap.png)

```python
# Apply a global lens
lensed = lu.apply_lens(projector, lens, resolution=6)
x, y = lu.extract_embedding(lensed)
plt.scatter(x, y, 2, lens, cmap="viridis")
plt.axis("off")
plt.show()
```

![Lensed model](docs/_static/lensed_umap.png)


## Example Notebooks

A notebook demonstrating how the package works is available at 
[How lensed UMAP Works](https://nbviewer.org/github/vda-lab/lensed_umap/blob/master/notebooks/01_How_lensed_UMAP_works.ipynb).
The other notebooks demonstrate lenses on several data sets and contain the
analyses presented in our paper. The datasets we used as input and the data
generated by our notebooks are stored using [git lfs](https://git-lfs.com/),
which turns the files in this repository into versioned links to the actual data
files. Their documentation explains how to retrieve the actual data files.

## Installing

`lensed_umap` is available on PyPI:

```bash
pip install lensed_umap
```

## Citing

A scientific paper describing our work is available on Arxiv:

```bibtex
@misc{bot2024lens,
  title={Lens functions for exploring UMAP Projections with Domain Knowledge}, 
  author={Daniel M. Bot and Jan Aerts},
  year={2024},
  eprint={2405.09204},
  archivePrefix={arXiv},
  primaryClass={cs.LG}
}
```

## Licensing

The lensed UMAP package has a 3-Clause BSD license.
swh.auth 0.10.2
Software Heritage authentication utilities
Requires Python: >=3.9

Software Heritage - Authentication
==================================

``swh-auth`` is a set of utility libraries related to user authentication
in applications and services based on the use of `Keycloak`_ and `OpenID Connect`_.

`Keycloak`_ is an open source software enabling single sign-on (SSO) with identity
and access management.

`OpenID Connect`_ (OIDC) is an authentication layer on top of `OAuth 2.0`_, widely
used in modern web applications and services.

``swh-auth`` notably offers the following features:

- the ``swh.auth.keycloak.KeycloakOpenIDConnect`` class to ease the
  interaction with a Keycloak server

- a ``pytest`` plugin with the ``keycloak_oidc`` fixture to mock Keycloak
  responses in unit tests

- generic backends, views and middlewares to easily plug OpenID Connect authentication
  in any `Django`_ or `Django REST framework`_ application


.. _Keycloak: https://www.keycloak.org/

.. _OpenID Connect: https://openid.net/connect/

.. _OAuth 2.0: https://oauth.net/2/

.. _Django: https://www.djangoproject.com/

.. _Django REST framework: https://www.django-rest-framework.org/
FStringInterpolation 0.2.0
interpolation for python's `configparser` that does f-string substitution
Requires Python: >=3.6

FStringInterpolation - interpolation `configparser` that does f-string substitution
===================================================================================

Extended *Interpolation* for the normal [Python `configparser`](https://docs.python.org/3/library/configparser.html)

- Apply [f-string](https://docs.python.org/3/reference/lexical_analysis.html#f-strings) interpolation on values.


## Usage

```python
>>> import configparser
>>> from fstringinterpolation import FStringInterpolation
>>> config = configparser.ConfigParser(interpolation=FStringInterpolation())
>>> config.read_string("""
[DEFAULT]
_pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286
[full]
pi = {_pi}
[short]
pi = {float(_pi):.2f}
[stringy]
pi = {_pi:.2s}
""")
>>> config["full"]["pi"]
'3.141592653589793238462643383279502884197169399375105820974944592307816406286'
>>> config["short"]["pi"]
'3.14'
>>> config["stringy"]["pi"]
'3.'
```

## More examples

This will automatically create the proper *title*, depending on the values of *a* and *b*

#### Input
```ini
[DEFAULT]
a = 7
title = {a} is {"more" if float(a) > float(b) else "less"} than {b}
[A]
b = 12
[B]
b = 3
[C]
a = 3.14
b = 2.71
```

#### Output

| section | title                    |
|---------|--------------------------|
| A       | "7 is less than 12"      |
| B       | "7 is more than 3"       |
| C       | "3.14 is more than 2.71" |


# Installing

TODO

# Building


```sh
python3 -m build
```

# Caveats
- no recursion!
  e.g. the following is invalid:
  ```ini
  [DEFAULT]
  pi = 3.141592654
  [int]
  pi = {float(pi)}
  ```

- the type of each value is always <str>.
  if you need something else, you must explicitely convert the values:
  ```ini
  [DEFAULT]
  pi = 3.141592654
  [bad]
  halfpi = {pi/2}
  [good]
  halfpi = {float(pi)/2}

- care must be taken to not override python built-ins (that you want to use) with variables:
  ```ini
  [DEFAULT]
  a = 10
  b = 12
  [good]
  realsum = {sum(float(_) for _ in [a,b])}
  [bad]
  realsum = {sum(float(_) for _ in [a,b])}
  sum = 22
  [bad recursion]
  sum = {sum(float(_) for _ in [a,b])}
  ```

- currently, recursion is somewhat broken (unless the interpolated values are re-used as strings):
  ```ini
  [test]
  a = 3
  # b becomes '4'
  b = {int(a)+1}
  # GOOD: c becomes '34' ('3'+'4')
  c = {a+b}
  # BAD: d should become 7, but really fails with "int('{int(a)+1)}')"
  d = {int(a)+int(b)}
  ```
localtest 1.1.0
A home to locally running tests such as testing your network speeds!
Requires Python: >=3.8

# Localtest

Localtest is a **CLI** tool to test stuff **locally**. This can be from **your network** to **IMPROVING** it?! That's **right**. From version *1.1* _onwards_, you'll be able to **IMPROVE** your network speeds from using **Localtest**. Use the command ```localtest help``` to view **all** available commands and flags in your **current version**, it'll be **up-to-date**. _Localtest was built for Hack Club's Summer of Making._

## Localtest Network

Use ```localtest network run``` to **start** a **quick** Network test. _If you have time on your hands_, you should do ```localtest network run -fs``` for a **full** scan, which will take _longer_, but will be more **accurate**!

## Localtest Hardware

Localtest Hardware _(tm)_ is an _upcoming_ feature for **Localtest** and it is to tell you which **games** _(and tools)_ you can **smoothly** run on and which you **can't** smoothly run. **Star** this project to see _more_ of Localtest! _:3_
aioretry-decorator 1.0.6
Handy decorator to set retry policies for async callables with some useful features

# aioretry
Handy decorator to set retry policies for async callables with some useful features

# Usage examples

```
@retry(
    tries=5,
    allowed_exceptions=(RuntimeError,),
    intervals=(5, 7, 10),
    fail_cb=make_request_callback,
)
async def make_request(address, client):

    ... http request code goes here...

    if response.status_code >= 300:
        raise RuntimeError()

def make_request_callback(address, client)
    ...
```

- 5 retries will be performed
- with 5, 7, 10, 10 and 10 seconds interval between retries.
  I.e. if `intervals` tuple length more than `tries` number,
  the last tuple interval will be used for the rest of the tries.
- `make_request_callback()` synchronous function will be called if all attempts are failed
- The accepted exceptions tuple allows you to control when to retry.
- You can optionally pass a custom `logger: logging.Logger` to the decorator
  within a `logger=` parameter. Otherwise `retry_decorator` logger will be created to log retries.


Other possible ways to use this decorator:
```
@retry(5, (MyCustomError,), (5, 7, 10), make_request_callback)

@retry(3, (MyCustomError,), (1,))

# this actually will either successfully return or fail on first exception occured
@retry(3)
```

Look into `tests.py` to see more on usage.


# Installation

Available as a package on pypi:

`pip install aioretry-decorator`

Or install it directly from GitHub:

`pip install git+https://github.com/remort/aioretry.git#egg=aioretry_decorator`
ksphinx 0.2.2
A custom html theme for sphinx used in kuankuan2007's projects.
Keywords: sphinx, theme

# KSphinx

KSphinx is a Sphinx html theme used by kuankuan's other projects.

## Installation

```bash
pip install ksphinx
```

## Usage

```python
# conf.py
html_theme = 'ksphinx'
```

## Advantages

- There is a switch between light and dark themes (supporting the following system)
- Supports menu folding and allows you to decide based on the page width

## Open Source

The paackage is open source under [MulanPSL-2.0 license](./LICENSE)