semvec/pypi-packages huggingface dataset:
ansiblecall 0.3.5
Call ansible modules with python script
Requires Python: >=3.10

# Ansible Call
[![CI](https://github.com/cheburakshu/ansible-call/actions/workflows/cicd.yml/badge.svg)](https://github.com/cheburakshu/ansible-call/actions/workflows/cicd.yml)

`ansible-call` is a Python package that allows you to interact with Ansible modules directly from your Python code. This package is designed to make it easier to call and work with Ansible modules programmatically.

## Installation

You can install `ansible-call` from PyPI using pip:

```bash
pip install ansiblecall
```

## Example

```python
import ansiblecall

# Call the 'ping' module from 'ansible.builtin'
result = ansiblecall.module('ansible.builtin.ping', data='hello')

# Print the result
print(result)

# Prints
# {'ping': 'hello'}
```

## Contributing

Contributions are welcome! If you'd like to contribute to ansible-call, please fork the repository and submit a pull request with your changes. Make sure to follow the project's coding standards and include tests for any new features.

## License
`ansible-call` is licensed under the GNU GPLv3 License. See the LICENSE file for more details.
canonicalwebteam.sitemaps-parser 1.0.3
Flask extension to parse websites and extract structured data to build sitemaps.

# canonicalwebteam.sitemaps-parser
Flask extension to parse websites and extract structured data to build sitemaps.

## Install
Install the project with pip: `pip install canonicalwebteam.sitemaps-parser`

You can add the extension on your project by doing the following:

```
from canonicalwebteam.sitemaps_parser import scan_directory

node = scan_directory("<example-templates-path>)
```

`node` will return a tree of all the templates given in the `<example-templates-path>

## Local development

### Linting and formatting

Tests can be run with Tox:
```
pip3 install tox  # Install tox
tox -e lint       # Check the format of Python code
tox -e format     # Reformat the Python code
```
kapsula 0.2.1
Great for adding markdown docs to llm. Dead simple docs generator. Originally used at Metabob.com

<div align=center width=150>

  ![](https://raw.githubusercontent.com/Abdur-rahmaanJ/kapsula/stable/assets/logo.png)
  
</div>

# kapsula

Great for adding markdown docs to llm.

Dead simple docs generator. Generates html and markdown docs. 

Have a clear view of the codebase without knowing any tooling

```
python -m kapsula . # path to folder
python -m kapsula path/ --exclude venv another_folder # excludes folders, venv excluded by default
python -m kapsula /path --debug # debug
python -m kapsula [directories] [output.html] [output.md] [flags]
python -m kapsula scripts buns docs.html docs.md --exclude venv
```

Makes onboarding a breeze!


## Generated Doc

- Treeview

![](https://raw.githubusercontent.com/Abdur-rahmaanJ/kapsula/stable/assets/tree_view.png)

- List view

![](https://raw.githubusercontent.com/Abdur-rahmaanJ/kapsula/stable/assets/list_view.png)

- Search

![](https://raw.githubusercontent.com/Abdur-rahmaanJ/kapsula/stable/assets/search.png)
Driver-L9110-i2c 25.3.13.0
A package for controlling JetRacer
Requires Python: >=3.11

# Initialize an L9110 I2C driver
    Parameters
        i2c_address (int): The i2c address of the L9110 chip. Default is 0x40.
        i2c_bus_number (int): The number of the I2C bus to use. Default is 1.
    Example: Initialize l9110 object with default address and default i2c bus
        l9110 = L9110()
    Example: Initialize object l9110 with address 0x42 and i2c bus 1
        l9110 = L9110(i2c_address=0x42, i2c_bus_number=1)

# rc_data_send(rc_motor, degree)
    Create a list of data to be sent to the L9110 in RC servo mode.
        Args:
            rc_motor (int): 1 for S1 or 2 for S2.
            degree (int): 0-180 of the servo's position.
        Returns:
            list: A list of data to be sent via i2c.
    Example: control servo 1 with 150 degree
        servo_data = l9110.rc_data_send(l9110.S1, 150)

# dc_data_send(dc, percent, direction)
    Create a list of data to be sent to the L9110 in DC motor mode.
        Args:
            dc (int): 0 for MA or 1 for MB.
            percent (int): Speed percentage (0-100) of the DC motor.
            direction (int): 0 for clockwise (CW) or 1 for counterclockwise (CCW).
        Returns:
            list: A list of data to be sent via i2c.
    Example: control DC motor with 50% speed and clockwise
        dc_data = l9110.dc_data_send(l9110.MA, 50, l9110.CW)

# set_address(old_address, new_address)
    Change the I2C address of the L9110 device.
        Args:
            old_address (int): The current I2C address of the device.
            new_address (int): The new I2C address to be set for the device.
        Raises:
            IOError: If there is an error in communication with the device.
    Example: set i2c address to 0x42
        set_address(0x40, 0x42)
rtql8 0.1.1
RTQL8 a given cron expression
Requires Python: >=3.13

# RTQL8

Python library for cron parsing and description generation.

## Installation

```bash
pip install rtql8
```

## Development Installation

```bash
poetry install
```

## Usage

```python
from rtql8 import Cron

cron = Cron("* * * * *")
print(cron.description)
```

## Usage for CLI

```bash
rtql8 -e "* * * * *"

# Output
Every minute
```

Another way is using `poetry run`:

```bash
poetry run rtql8 -e "0 0 1,15 * ?"

# Output
At midnight, on 1st and 15th of the month
```

## Testing

```bash
poetry run pytest
```

or run specific test case, for example, `test_cli.py` in `test_cron.py`:

```bash
poetry run pytest tests/test_cli.py
```

or

```bash
poetry run pytest tests/test_cron.py
```

## License

MIT
sbmutils 0.2.3
A collection of SBM utility functions
Requires Python: >=3.6

# sbmutils
A collection of SBM functions.

## Installation
```bash
pip install sbmutils
```

## Features

### Preprocessing

#### Normalization
- `quantilenorm`: Performs 2D quantile normalization over columns
  - Supports both mean and median averaging methods
  - Handles missing values (NaN)
  - Input validation and error handling
- `stacked_quantilenorm`: Performs quantile normalization on stacked data with batch information
- `referenced_quantilenorm`: Normalizes data using reference quantiles
- `standardize`: Standardizes data by centering and scaling

#### Biological Normalization
- `comba/combat_seqt`: Batch effect correction using ComBat
- `counts_to_fpkm`: Converts count data to FPKM

#### Filtering
- `parse_gtf`: Parses GTF files for gene information
- `get_gene_id_to_entrez_mapper`: Maps gene IDs to Entrez IDs
- `entrez_filtering`: Filters data based on Entrez IDs
- `protein_coding_filtering`: Filters for protein-coding genes

### Decomposition
- `NMF`: Non-negative Matrix Factorization implementation

## Usage

```python
import numpy as np
import pandas as pd
from sbmutils.preprocess import quantilenorm, standardize, combat
from sbmutils.decomp import NMF

# Quantile normalization example
data = pd.DataFrame([[1, 4], [2, 5], [3, 6]])
normalized_data = quantilenorm(data, average="mean")

# Batch effect correction
counts = pd.DataFrame(...)  # Your count data
batch = [1, 1, 2, 2, ...]   # Batch information
corrected_data = combat(counts, batch)

# NMF decomposition
nmf = NMF(num_components=3)
nmf.fit(data)
```

## Requirements

- Python >= 3.6
- NumPy >= 1.19.0
- SciPy >= 1.7.0
- inmoose >= 0.1.0
- pyranges >= 0.0.100
- gtfparse >= 1.2.1
- pybiomart >= 0.1.0


## How to check MATLAB compatibility
1. Intall MATLAB engine for python

```python
cd "mablab_root/extern/engines/python"
python setup.py install
```

2. Start MATLAB engine
```python
import matlab
import matlab.engine
eng = matlab.engine.start_matlab()
```

3. Test with MATLAB function

```python
x_matlab = matlab.double(x_python.tolist())

result_python = function(x_python)
result_matlab = eng.function(x_matlab)

np.testing.assert_array_almost_equal(result_python, result_matlab)
```

## License
This project is licensed under the MIT License. 

```python
import matlab
import matlab.engine

"""
test code for NMF
"""
eng = matlab.engine.start_matlab()

x = np.random.randn(1000, 200)
x.ravel()[np.random.choice(x.size, 128, replace=False)] = np.nan
w = np.random.uniform(size=[1000, 4])
h = np.random.uniform(size=[4, 400])

nmf = NMF(num_components=4, num_iter=10, nmf_iter=10)
nmf.fit(x, init_w=w, init_h=h)

coph_cor_py = nmf.correlation_coefficient
ave_C_py = nmf.consensus_matrix

x_matlab = matlab.double(x.tolist())
w_matlab = matlab.double(w.tolist())
h_matlab = matlab.double(h.tolist())
out_m = eng.aoNMF_subtyping_NaN(x_matlab, 4, 10., 10., w_matlab, h_matlab, nargout=4)

coph_cor_m = np.array(out_m[0])
ave_C_m = np.array(out_m[1])

np.testing.assert_array_almost_equal(coph_cor_py, coph_cor_m)
np.testing.assert_array_almost_equal(ave_C_py, ave_C_m)
```
transferattack 1.1
A PyTorch library for adversarial attacks
Requires Python: >=3.7

# TransferAttacks

## Overview
TransferAttacks is a PyTorch library for implementing adversarial attacks with improved transferability. It includes state-of-the-art methods categorized into different approaches:

- **Gradient-based**: Modify gradients for enhanced transferability.
- **Ensemble-based**: Use multiple models to improve attack success.
- **Generation-based**: Train generative models to craft adversarial examples.

## Installation
```sh
pip install transferattacks
```

## Supported Attacks

### Gradient-based Methods
- **[BPA](https://arxiv.org/abs/2306.12685)**: Recovers truncated gradients in non-linear layers.
- **[AGS](https://ojs.aaai.org/index.php/AAAI/article/view/28365)**: Uses adversary-centric contrastive learning.
- **[MetaSSA](https://arxiv.org//abs/2405.03193)**: Utilizes low-frequency feature mixing.
- **[VDC](https://ojs.aaai.org/index.php/AAAI/article/view/28541)**: Adds virtual dense connections for dense gradient backpropagation.
- **[MA](https://arxiv.org/abs/2311.18495)**: Minimizes KL divergence between models.

### Ensemble-based Methods
- **[Ens](https://arxiv.org/abs/1611.02770)**: Generates adversarial examples using multiple models.
- **[Ghost](https://arxiv.org/abs/1812.03413)**: Uses dropout and random scaling to create ghost networks.
- **[SVRE](https://arxiv.org/pdf/2111.10752)**: Uses variance-reduced gradients.
- **[LGV](https://arxiv.org/abs/2207.13129)**: Ensembles multiple weight sets.
- **[MBA](https://arxiv.org/abs/2302.05086)**: Maximizes average prediction loss using Bayesian optimization.
- **[AdaEA](https://arxiv.org/abs/2308.02897)**: Adjusts surrogate model weights dynamically.
- **[CWA](https://arxiv.org/abs/2303.09105)**: Exploits common weaknesses in an ensemble.
- **[SMER](https://openaccess.thecvf.com/content/CVPR2024/papers/Tang_Ensemble_Diversity_Facilitates_Adversarial_Transferability_CVPR_2024_paper.pdf)**: Uses reinforcement learning for weight refinement.

### Generation-based Methods
- **[CDTP](https://arxiv.org/abs/1905.11736)**: Learns domain-invariant perturbations.
- **[LTP](https://proceedings.neurips.cc/paper/2021/hash/7486cef2522ee03547cfb970a404a874-Abstract.html)**: Uses mid-level features for perturbation generation.
- **[ADA](https://arxiv.org/abs/2208.05650)**: Stochastically perturbs shared salient features.
- **[GE-ADVGAN](https://arxiv.org/pdf/2401.06031)**: Enhances adversarial transferability via gradient editing.

## Usage
```python
from transferattacks import FGSM
attack = FGSM(model, epsilon=0.03)
adv_images = attack.generate(images, labels)
```

## Citation
If you use TransferAttacks in your research, please cite the corresponding papers.

## License
MIT License
uvi 0.5.0
A python cookiecutter application to create a new python project that uses uv to manage its dependencies.
Requires Python: <4.0,>=3.10
Keywords: cookiecutter, template, uv

# `uvi` uv init

[![Build status](https://img.shields.io/github/actions/workflow/status/shaneholloman/uvi/main.yml?branch=main)](https://github.com/shaneholloman/uvi/actions/workflows/main.yml?query=branch%3Amain)
[![Supported Python versions](https://img.shields.io/badge/python-3.10_%7C_3.11_%7C_3.12_%7C_3.13-blue?labelColor=grey&color=blue)](https://github.com/shaneholloman/uvi/blob/main/pyproject.toml)
[![Docs](https://img.shields.io/badge/docs-gh--pages-blue)](https://shaneholloman.github.io/uvi/)
[![License](https://img.shields.io/github/license/shaneholloman/uvi)](https://img.shields.io/github/license/shaneholloman/uvi)

This is a modern Cookiecutter template that can be used to initiate a Python project with all the necessary tools for development, testing, and deployment. It supports the following features:

> [!IMPORTANT]
> This project 'works' but is far from perfect!

See todos: [TODO.md](./TODO.md)

- [uv](https://docs.astral.sh/uv/) for dependency management
- CI/CD with [GitHub Actions](https://github.com/features/actions)
- Pre-commit hooks with [pre-commit](https://pre-commit.com/)
- Code quality with [ruff](https://github.com/charliermarsh/ruff) (including Pylint-equivalent rules), [mypy](https://mypy.readthedocs.io/en/stable/), [deptry](https://github.com/shaneholloman/deptry/), and [prettier](https://prettier.io/)
- Publishing to [PyPI](https://pypi.org) by creating a new release on GitHub
- Testing and coverage with [pytest](https://docs.pytest.org/en/7.1.x/) and [codecov](https://about.codecov.io/)
- Documentation with [MkDocs](https://www.mkdocs.org/)
- Compatibility testing for multiple versions of Python with [tox-uv](https://github.com/tox-dev/tox-uv)
- Containerization with [Docker](https://www.docker.com/)
- Development environment with [VSCode devcontainers](https://code.visualstudio.com/docs/devcontainers/containers)

## Docs

- [Docs](https://shaneholloman.github.io/uvi/)

## Installation & Usage

> For both methods follow the prompts to configure your project. Once completed, a new directory containing your project will be created. Then navigate into your newly created project directory and follow the instructions in the `README.md` to complete the setup of your project.

### Method 1: Using the CLI tool (Recommended)

Install the `uvi` tool globally:

```bash
uv tool install uvi
```

```bash
# or using pip
pip install uvi
```

Then navigate to the directory where you want to create your project and run:

```bash
uvi
```

### Method 2: Using Cookiecutter directly

Alternatively, you can use cookiecutter directly:

```bash
uvx cookiecutter https://github.com/shaneholloman/uvi.git
# or if you don't have uv installed:
pip install cookiecutter
cookiecutter https://github.com/shaneholloman/uvi.git
```
itc2kc 0.1.1
A converter for iTerm2 to kitty themes
Requires Python: >=3.12

# itc2kc (pronounced: it-see-too-kay-see)

A stupidly named utility to convert an iTerm2 theme to a `kitty` theme. This script uses `lxml` to parse the `.itermcolors` file provided as input and transform into a `.conf` file to be used by `kitty`

## Acknowledgements

- [Bliss iTerm2 Theme](https://github.com/joshjon/bliss-iterm) by @joshjon
- [kitty](https://sw.kovidgoyal.net/kitty/) by Kovid Goyal

## Contributing

This was a little experiment so feel free to tweak or send me suggestions.

## About

This started as a desire to have the Bliss theme on my kitty terminal, I wrote about developing this script [here](https://ericjohnson.bearblog.dev/itc2kc/)
snotation 0.1.0
A lightweight scientific notation handler
Requires Python: >=3.6

/*

 Author: Oscar Maldonado
 Email: oscarmmgg1234@gmail.com

 Creation Date: 2025-03-12 20:21:09

 temp

*/
# SNotation: A Lightweight Scientific Notation Library

**SNotation** is a Python package that allows flexible parsing, manipulation, and formatting of scientific notation values.

## 🚀 Features
✅ Supports human-friendly scientific notation formats (`"8.99 x 10^9"`, `"8.99E9"`, `"8.99e9"`).  
✅ Provides accurate arithmetic operations for scientific notation values.  
✅ Custom output formats (`E`, `x 10^`, `e`).  
✅ Works with Python 3.6+.

## 📦 Installation
Install via pip:
```sh
pip install snotation
modelengine-agents 0.1.4
ModelEngine大语言模型代理工具库
Requires Python: >=3.10

# app-engine


# ModelEngine Agents Core

ModelEngine Agents Core 是一个基于 SmoLAgent 的增强版本,提供了丰富的 Agent 工具集和流式输出能力。

## 主要特性

- 继承 SmoLAgent 的核心能力
- 支持多种 Agent 工具:
  - Baidu 搜索/ Google 搜索
  - 格式化输出工具
- 流式输出支持
- 基于 FastAPI 的服务端实现
- 可扩展的消息观察者模式

## 核心组件

### CodeAgentME
代码执行 Agent,支持 Python 代码的解释和执行。

### LiteLLMModelME & OpenAIServerModelME 
支持多种 LLM 模型的接入。

### 工具集
- BaiduSearchTool: 百度搜索工具，通过爬虫实现检索，无需API。
- GoogleSearchTool: Google搜索工具，通过爬虫实现检索，无需API。
- EXASearchTool: EXA搜索工具，需要提供API-KEY。
- DuckDuckGoSearchTool: SmolAgent内置搜索工具，用多了会有速率限制。
- FinalAnswerFormatTool: 输出格式化工具，支持传入prompt控制输出格式。

### MessageObserver
消息观察者模式实现,用于处理 Agent 的流式输出。

## 使用方式
参考modelengine_agents.core server.py