semvec/pypi-packages huggingface dataset:
loclx-colab 0.1.3
A lightweight Python package that creates a seamless bridge between Google Colab notebooks and Localxpose service. It enables easy exposure and access to web applications running in Colab environments  making it simple to test and showcase web services directly from your Colab notebooks.

# loclx_colab

loclx_colab is a lightweight Python package that creates a seamless bridge between Google Colab notebooks and Localxpose service. It enables easy exposure and access to web applications running in Colab environments, making it simple to test and showcase web services directly from your Colab notebooks.

## Features

- Automatic `loclx` package installation 
- LocalXpose service management
- Create, stop and list  HTTP tunnels 

## Installation

To install the package on Colab, run:

```bash
!pip install loclx_colab

```

## Usage
Create an HTTP tunnel
```Python
import loclx_colab.loclx as lx

port = 1234 # The service port that you want to expose
access_token = "your_access_token" # Your LocalXpose token here
url = lx.http_tunnel_start(port, access_token) 
print(f"Your service is exposed to this URL: {url}")
```
Stop the HTTP tunneling service 
```Python
lx.http_tunnel_stop()
```
List HTTP tunels
```Python
lx.http_tunnel_status()
```
## Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
pppc 0.1.8
Create Minecraft Paper plugins using Python
Requires Python: >=3.8

# PPPC (PythonPaperPluginCompiler)

> ⚠️ **BETA WARNING**: This project is currently in active development and beta phase. APIs may change without notice, and some features might be incomplete or unstable. Use in production environments at your own risk.

PPPC is a Python module that allows you to create Minecraft Paper plugins using Python syntax. It's designed to be beginner-friendly while providing powerful functionality for creating Minecraft server plugins.

## Development Status

- 🚧 **Beta Phase**
- ⚠️ Breaking changes may occur
- 📝 Documentation is being actively developed
- 🐛 Bug reports and feedback are welcome
- 🤝 Contributions are encouraged

## Features

- Python-like syntax for creating Minecraft Paper plugins
- No Java knowledge required
- Support for multiple Bukkit API versions
- Easy event handling and command creation
- Automatic compilation to JAR files

## Quick Start

```python
from pppc import Plugin, Event, event_handler, command

# Create a plugin
plugin = Plugin(
    name="MyPlugin",
    version="1.0.0",
    description="My first plugin",
    author="YourName"
)

# Handle events
@event_handler("PlayerJoinEvent")
def on_player_join(event):
    player = event.data["player"]
    player.send_message("Welcome!")

# Create commands
@command(name="hello", description="Says hello")
def hello_command(sender, args):
    sender.send_message("Hello!")

# Compile the plugin
from pppc import compile_plugin
jar_path = compile_plugin(plugin)
```

## Supported Versions

- 1.21.3 (default)
- 1.20.4
- 1.19.4
- 1.18.2
- 1.17.1
- 1.16.5

## Installation

```bash
pip install pppc
```

## Known Limitations

During the beta phase, please be aware of the following limitations:

- Some advanced Paper API features might not be fully implemented
- Performance optimizations are ongoing
- Error messages and debugging tools are being improved
- Documentation is being expanded

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. During the beta phase, we especially appreciate:

- Bug reports
- Feature requests
- Documentation improvements
- Test coverage improvements
- Code quality enhancements

## License

This project is licensed under the MIT License - see the LICENSE file for details.
sero-ps 0.1.0
A Python module for finding prime numbers using the Sieve of Eratosthenes
Requires Python: >=3.6

# Sero

**Sero** is a simple Python package that contains useful functions for prime number generation and feature scaling.

## Features

- `soe`: Sieve of Eratosthenes for finding prime numbers up to a given number.
- `scale_feature`: Scales numerical data using Z-score normalization or Min-Max scaling.

## Installation

To install the package, you can clone the repository or use pip if available.

### Using pip:

pip install sero
matrix-operations-amber 0.3.0
A simple package for matrix operations
Requires Python: >=3.6

#  Matrix Operations of Amber Hou

[![PyPI version](https://badge.fury.io/py/matrix_operations.svg)](https://badge.fury.io/py/matrix_operations)
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)

A simple Python package for matrix operations including addition and multiplication.

## Installation

To install the `matrix_operations_amber` package, run the following command in your terminal:

```bash
pip install matrix_operations_amber
```
## Usage
### Matrix Addition
````bash
from matrix_operations_amber import add_matrices

matrix1 = [[1, 2], [3, 4]]
matrix2 = [[5, 6], [7, 8]]

result_add = add_matrices(matrix1, matrix2)
print("Matrix Addition Result:", result_add)
````
### Matrix Multiplication
``````bash
from matrix_operations_amber import multiply_matrices

matrix1 = [[1, 2], [3, 4]]
matrix2 = [[5, 6], [7, 8]]

result_multiply = multiply_matrices(matrix1, matrix2)
print("Matrix Multiplication Result:", result_multiply)
``````
## Features

    Matrix Addition: Adds two matrices of the same dimensions.
    Matrix Multiplication: Multiplies two matrices if the number of columns in the first matrix is equal to the number of rows in the second.
## CONTRIBUTING
Contributions are welcome! Please read CONTRIBUTING.md for details on how to contribute.
## License
This project is licensed under the MIT License. See the LICENSE file for details.
## Contact
For any questions or suggestions, please contact me at 1471147972@qq.com.
sphinx-testify 0.1.1
A Sphinx directive which enables testifying documentation by explicitly referencing test results
Requires Python: >=3.12

![Build](https://github.com/basicwolf/sphinx-testify/actions/workflows/ci.yml/badge.svg)

# Sphinx-testify

sphinx-testify is an extension to the Sphinx documentation generator,
that enables building [testified documentation][] and, ultimately
[living documentation][].

[testified documentation]: https://www.zaurnasibov.com/posts/2024/09/29/testified-documentation.html#testified-documentation
[living documentation]: https://gojko.net/books/specification-by-example/

## Testified documentation in a nutshell

Testified documentation means that the documentation source references test
results, and these references are verified during the build process.
As a result, we can keep every paragraph even every sentence of
the documentation aligned with the code, as long as there is a test
that "testifies" the described behaviour.


## A simple example

Imagine you're working on a system access module.
Even *before* writing any tests or code, you can briefly document
the expected behavior and reference the (to-be-created) tests.
Proceed with a TDD cycle, and once all the tests and implementation
are ready, you’ll have testified and living documentation.

Here's how it looks like in a reStructuredText document:

```rst

   System access
   =============

   Only a user with valid credentials: a username and a password can access
   the system. If credentials are wrong, the system returns "Authentication failed"
   error message.

   .. testify::
      test_a_user_can_access_system_with_username_and_password
      test_system_returns_authentication_failed_error_when_username_is_not_found
      test_system_returns_authentication_failed_error_when_password_is_wrong
```

## Installation

```shell
pip install sphinx-testify
```

## Links

Code: https://github.com/BasicWolf/sphinx-testify
<br>
Docs: https://sphinx-testify.readthedocs.io/en/latest/

## License

GPLv3
chill-filter 0.4.1
rapid sample screening for shotgun DNA sequencing data sets

# chill-filter: Rapid sample screening for shotgun sequencing data

## Quickstart for the Web site:

0. Clone the repo:

```
git clone https://github.com/dib-lab/chill-filter
cd chill-filter/
```

1. Install flask, sourmash_plugin_branchwater, pandas, and snakemake.

```
conda env create -f environment.yml -n chill
conda activate chill
```

2. Download the databases from [the Open Science Framework project](https://osf.io/m85ux/), and unpack them into `prepare-db/outputs/`.

```
curl -JLO https://osf.io/download/5fw2v/
unzip -d prepare-db/ -nu chill-filter-db-0.4.zip
```

3. Run snakemake in the `sample-db/` directory to index the databases. It should take a few minutes at most.

```
(cd prepare-db && snakemake -j 1 -p)
```

4. Run `chill_filter_web`:

```
mkdir -p /tmp/chill
python -m chill_filter_web -p 5000
```

This will start a server at http://localhost:5000/

5. Try uploading some FASTQ or FASTA files, or check out the examples!
talentwizer-commons 0.1.0
Common utilities and objects for Talentwizer projects
Requires Python: <3.12,>=3.11

## Getting Started

First, setup the environment:

```
poetry install
poetry shell
```

By default, we use the OpenAI LLM (though you can customize, see `app/context.py`). As a result you need to specify an `OPENAI_API_KEY` in an .env file in this directory.

Example `.env` file:

```
OPENAI_API_KEY=<openai_api_key>
```

Second, generate the embeddings of the documents in the `./data` directory (if this folder exists - otherwise, skip this step):

```
python index_data.py
```

Third, run the development server:

```
python main.py
```

Then call the API endpoint `/api/chat` to see the result:

```
curl --location 'localhost:8000/api/chat' \
--header 'Content-Type: application/json' \
--data '{ "messages": [{ "role": "user", "content": "Hello" }] }'
```

You can start editing the API by modifying `app/api/routers/chat.py`. The endpoint auto-updates as you save the file.

Open [http://localhost:8000/docs](http://localhost:8000/docs) with your browser to see the Swagger UI of the API.

The API allows CORS for all origins to simplify development. You can change this behavior by setting the `ENVIRONMENT` environment variable to `prod`:

```
ENVIRONMENT=prod uvicorn main:app
```
aioshutdown 0.0.4
Context manager that provides simple graceful shutdown interface for your asyncio tasks.
Requires Python: >=3.8
Keywords: asyncio, graceful, shutdown

# aioshutdown

Context manager that provides simple graceful shutdown interface for your asyncio tasks.

## Installation

```
pip install -U aioshutdown
```

## Usage

Just specify the list of signals that you want to intercept using the `|` operator:

```python
from aioshutdown import SIGTERM, SIGINT, SIGHUP


with SIGTERM | SIGHUP | SIGINT as loop:
    ...
```

The context manager will return an instance of the current event loop. You can intercept signals directly inside your coroutines:

```python
async def my_task(sleep: int):
    try:
        """ Main logic of your coroutine. """
    except asyncio.CancelledError as exc:
        """ In this place you can gracefully complete the work. """
```

Full example:


```python
import asyncio
from aioshutdown import SIGTERM, SIGINT, SIGHUP
import logging


logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s,%(msecs)d %(levelname)s: %(message)s",
    datefmt="%H:%M:%S",
)

async def my_task(sleep: int):
    try:
        while True:
            logging.info("Sleep from task #%s", sleep)
            await asyncio.sleep(sleep)
    except asyncio.CancelledError as exc:
        # Received an exit signal. In this place we gracefully complete the work.
        signal = exc.args[0] # NOTE: works in Python >= 3.9 only: https://docs.python.org/3/library/asyncio-future.html?highlight=Changed%20in%20version%203.9:%20Added%20the%20msg%20parameter.#asyncio.Future.cancel
        logging.warning("Received %s signal. Shutting down...", signal.value)

# Usage with `run_forever`

with SIGTERM | SIGHUP | SIGINT as loop:
    tasks = [loop.create_task(my_task(i)) for i in range(1, 10)]
    loop.run_forever()

# Usage with `run_until_complete`

with SIGTERM | SIGHUP | SIGINT as loop:
    tasks = [loop.create_task(my_task(i)) for i in range(1, 10)]
    loop.run_until_complete(asyncio.gather(*results))
```

Output

```
23:04:05,798 INFO: Sleep from task #1
23:04:05,798 INFO: Sleep from task #2
23:04:06,799 INFO: Sleep from task #1
23:04:07,800 INFO: Sleep from task #2
23:04:07,800 INFO: Sleep from task #1
23:04:08,801 INFO: Sleep from task #1
^C23:04:09,504 INFO: Received exit signal SIGINT...
23:04:09,504 INFO: Cancelling 2 outstanding tasks
23:04:09,504 WARNING: Received 2 signal. Shutting down...
23:04:09,504 WARNING: Received 2 signal. Shutting down...
23:04:09,504 INFO: Stopping event loop
```


## Useful links

[Graceful Shutdowns with asyncio](https://www.roguelynn.com/words/asyncio-graceful-shutdowns/)
spectral-bridges 1.3.0
Spectral Bridges clustering algorithm
Requires Python: >=3.8

# Spectral Bridges

Spectral Bridges is a Python package that implements a novel clustering algorithm combining k-means and spectral clustering techniques. It leverages efficient affinity matrix computation and merges clusters based on a connectivity measure inspired by SVM's margin concept. This package is designed to provide robust clustering solutions, particularly suited for large datasets.

## Features

- **Spectral Bridges Algorithm**: Integrates k-means and spectral clustering with efficient affinity matrix calculation for improved clustering results.
- **Scalability**: Designed to handle large datasets by optimizing cluster formation through advanced affinity matrix computations.
- **Customizable**: Parameters such as number of clusters, iterations, and random state allow flexibility in clustering configurations.
- **Model selection**: Automatic model selection for number of nodes (m) according to a normalized eigengap metric.

## Speed

Starting with version 1.0.0, Spectral Bridges not only utilizes FAISS's efficient k-means implementation but also uses a scikit-learn method clone for centroid initialization which is much faster (over 2x improvement).

## Installation

You can install the package via pip:

```bash
pip install spectral-bridges
```

## Usage

### Example

```python
from spectralbridges import SpectralBridges
import numpy as np

# Generate sample data
np.random.seed(0)
X = np.random.rand(100, 10)  # Replace with your dataset

# Initialize and fit Spectral Bridges (with a specified number of nodes if needed) and random seed
model = SpectralBridges(n_clusters=5, random_state=42)

# Define range of nodes to evaluate, should be an iterable of integers, or None if n_nodes is already set.
n_nodes_range = [10, 15, 20]

# Find the optimal number of nodes for a given value of clusters
# Modifies the instance attributes, returns a dict
# If n_nodes_range is None, then the model selects using self.n_nodes if not None
mean_ngaps = model.fit_select(X, n_nodes_range) 

print("Optimal number of nodes:", model.n_nodes)
print("Dict of mean normalized eigengaps:", mean_ngaps)

# Predict clusters for new data points
new_data = np.random.rand(20, 10)  # Replace with new data
predicted_clusters = model.predict(new_data)

print("Predicted clusters:", predicted_clusters)

# With a custom number of nodes
custom_model = SpectralBridges(n_clusters=5, n_nodes=12, p=1) # And a p-bridge affinity

# Fit the model
custom_model.fit(X)

# Predict the same way...
custom_predicted_clusters = custom_model.predict(new_data)

print("Predicted clusters:", custom_predicted_clusters)
```
ftracer 1.6
Decorator functions to trace invocation of functions and class methods.

# ftracer Package

ftracer - decorator functions to trace invocation of functions and class methods

## DESCRIPTION

A Python module for tracing function and method invocations with detailed,
customizable logging. The `ftracer` module provides tools for decorating
individual functions, all functions in a module, and all methods in a class to
log their invocation, arguments, and return values. This is particularly
useful for debugging and understanding the flow of execution in your code.

`ftracer` allows developers to:
- Decorate individual functions with the `@trace` decorator to log their
  calls.
- Decorate entire classes with the `@trace_methods` decorator to trace all
  method calls within a class.
- Automatically attach decorators to all functions or classes in a module
  using `trace_all_functions` and `trace_all_classes`.
- Customize the tracing behavior, such as pretty-printing arguments and
  limiting list representations.

Key features:
- Customizable pretty-printer for function arguments and return values.
- Ability to apply tracing globally to all functions or classes in a module.
- Optional debug mode for additional trace logs.

---

## EXAMPLE

### Tracing Individual Functions

``` python
from ftracer import trace

@trace
def add(a, b):
    return a + b

result = add(5, 3)
```

```
** add(a=5, b=3)
```

### Tracing All Methods in a Class

``` python
from ftracer import trace_methods

@trace_methods
class Calculator:
    def multiply(self, x, y):
        return x * y

calc = Calculator()
calc.multiply(4, 7)
```

```
** multiply(self=<Calculator>, x=4, y=7)
```

### Applying Traces Globally in a Module

``` python
from ftracer import trace_all_functions

trace_all_functions()

def greet(name):
    return f"Hello, {name}!"

greet("Alice")
```

```
** greet(name='Alice')
```

# INSTALLATION

``` sh
pip3 install ftracer
```

# AVAILABILITY

The latest version of `ftracer` module is available at
PyPI (https://pypi.org/project/ftracer/) .

# SEE ALSO

- [Python Decorators](https://docs.python.org/3/glossary.html#term-decorator)

# AUTHOR

Hiroyuki Ohsaki <ohsaki[atmark]lsnl.jp>