semvec/pypi-packages huggingface dataset:
llm-probe 0.1.8
Extracting Intermediate Activations and Parameters from Hugging Face Models
Requires Python: >=3.10

<!---
Copyright 2024 The HyperAccel. All rights reserved.
-->

<p align="center">
    <br>
    <img src="docs/images/logo.png" width="400"/>
    <br>
<p>

# LLM Probe: Tool for extracting intermediate data from HuggingFace LLM models using PyTorch Hooks

LLM Probe는 HuggingFace LLM 모델의 중간 데이터를 PyTorch Hook을 이용해 추출하는 도구입니다.

## Installation Requirements
- Python 3.10 이상
- PyTorch 2.4.0 이상
- HuggingFace Transformers 4.35.0 이상

## Installation Method

### Install from PyPI
LLM Probe 프레임워크는 pip을 통해 설치할 수 있습니다:
```bash
pip install llm-probe
```

### Build from Source
LLM Probe 프레임워크는 소스 코드에서 설치할 수 있습니다:
```bash
# Clone the repository
git clone https://github.com/Hyper-Accel/llm-probe.git
cd llm-probe

# Install the package with Makefile script
make install INSTALL_MODE=[dev|release] PYTHON_VERSION=[3.10|3.11|3.12]
source .venv/bin/activate
```

설치 옵션:

- INSTALL_MODE: 설치 모드 지정 (기본값: dev)
    - dev: 개발용 패키지 설치 (ruff, pytest, pre-commit 등) 및 편집 가능 모드로 설치
    - release: 프로덕션용 패키지만 설치
- PYTHON_VERSION: Python 버전 지정 (기본값: 3.10)

## Usage

LLM-Probe를 사용하려면, Python 코드에서 해당 모듈을 임포트하고 hook을 적용할 모듈 이름을 지정하면 됩니다. 그 후 모델 추론을 수행하면 PyTorch hook이 자동으로 작동하며 원하는 중간 데이터를 추출할 수 있습니다. 아래는 사용 예시입니다:

```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

# LLM probe 패키지 임포트
from llm_probe.probe import HFModelProbe
from llm_probe.logger import get_logger

# 로거 초기화
logger = get_logger("HuggingFace probe 예제 코드")
logger.setLevel("DEBUG")

# 모델과 토크나이저 다운로드
model = AutoModelForCausalLM.from_pretrained("gpt2-medium")
tokenizer = AutoTokenizer.from_pretrained("gpt2-medium")

# 모델 probe 생성
model_probe = HFModelProbe(model, tokenizer)

# "transformer.h.0.ln_1" 모듈에 hook 설정
module = "transformer.h.0.ln_1"
model_probe.set_hook(module)

# 추론 수행
input_ids = model_probe.get_input_ids("Hello")
model_probe.generate(input_ids, max_new_tokens=1)

# 중간 데이터 가져오기
ln_1_input = model_probe.get_intermediate_input(module, dtype=torch.float16)
ln_1_output = model_probe.get_intermediate_output(module, dtype=torch.float16)
ln_1_weight = model_probe.get_intermediate_weight(module, dtype=torch.float16)
ln_1_bias = model_probe.get_intermediate_bias(module, dtype=torch.float16)
```
logperformance 1.0.1
Classe que implementa um logger com funções de log performance, log error, log warning, log info, log debug, log critical, log alert, log emergency, log warning, log error, log critical, log alert, log emergency
Requires Python: >=3.11

# LogPerformance

A Python logging utility class that provides performance monitoring, error tracking, and colored console output with file logging capabilities.

## Class Overview

`LogPerformance` is a singleton class that implements a comprehensive logging system with the following features:

- Colored console output
- File logging with timestamp-based filenames
- Performance monitoring for functions
- Error tracking
- Warning messages
- Custom log levels

## Methods

### `__new__(cls, *args, **kwargs)`

Singleton pattern implementation that ensures only one instance of the class exists.

### `__init__(self)`

Initializes the logger with:

- Colored console output handler
- File logging handler (if enabled)
- Custom log level configuration
- Directory creation for log files

### `check_exists_directory(work_directory: str) -> bool`

Static method that checks if a directory exists.

### `create_directory(cls, work_directory: str) -> None`

Class method that creates a directory if it doesn't exist and logs the creation.

### `log_performance(self, func: Callable) -> Callable`

Decorator that measures and logs the execution time of a function.

- Logs function name, arguments, and execution time
- Returns the function's result

### `log_error(self, func: Callable) -> Callable`

Decorator that catches and logs exceptions in a function.

- Logs the function name and error message
- Re-raises the exception after logging

### `log_warning(self, func: Callable) -> Callable`

Decorator that logs warnings for function execution.

- Logs function name, arguments, and execution time
- Returns the function's result

### `info(self, msg: str) -> None`

Logs an informational message with a smile emoji prefix.

### `warning(self, msg: str) -> None`

Logs a warning message.

### `error(self, msg: str) -> None`

Logs an error message with an exclamation mark emoji prefix.

### `_append_log_message(self, msg: str, level: int) -> None`

Private method that appends log messages with timestamp and level.

- Handles debug level filtering
- Stores the last log message

## Usage Example

```python
from logperformance import LogPerformance

log = LogPerformance()

@log.log_performance
def example_function(arg1, arg2):
    # Your code here
    pass

@log.log_error
def error_prone_function():
    # Your code here
    pass

# Log messages
log.info("This is an info message")
log.warning("This is a warning")
log.error("This is an error")
```

## Configuration

The logger can be configured using environment variables:

- `LOG_LEVEL`: Set to "DEBUG" for debug level logging
- `DEBUG_WRITE_FILE`: Set to "True" to enable file logging (default)
nsj-rest-test-util 0.1.14
Utilitários para testes de aplicações rests.
Requires Python: >=3.4

# nsj-rest-test-util
Utilitário para geração e execução de testes em APIs Rest

Esta biblioteca não se propõe a testar método e sim requisições.
A criação dos testes é automatizada, só é necessário preencher qual a requisição e qual a resposta esperada.

A biblioteca possui dois passos: a Criação e a Execução

A Criação de caso de teste é o processo que realiza um dump das informações no banco ele gera um csv com as informações do banco no momento da criação do teste e também realiza a requisção para a api que será testada para gerar assim o retorno que será comparado na hora de executar o teste.

A Execução do teste é realizada pelo pytest na pasta api/casos_de_teste
neste ponto ele carregará no banco os dados do csv criado na criação do teste e fará uma requisição para a api no tenant que foi configurado nas variaveis de ambiente.

# Variaveis de ambiente

DATABASE_HOST - Host do banco 
DATABASE_PASS - Senha do banco
DATABASE_PORT - Porta do banco
DATABASE_NAME - Nome da base de dados
DATABASE_USER - Usuario do banco

SERVER_PORT - porta da aplicação que será testada
TESTS_TENANT - tenant que será usado para inserção de dados de teste
TESTS_URL_BASE - url base da aplicação que será 


# Criação de caso de teste




    
 em src/util/tcase_tools altere o chamamento da função TCaseTools.criar_caso_teste_padrao no método main
     TCaseTools.criar_caso_teste_padrao(
        1,                          # Tenant que será feita a requisição ara montar o teste
        "/recursos",                # Rota que será feira a requisição
        "1234",                     # Codigo mope para a rota
        HTTPMethod.GET,             # Metodo HTTP que será feita a requisição
        204,                        # Código esperado para o retorno
        "exemplo1",                 # Nome que será usado para se referir ao teste
        JsonUtil().decode(""""""),  # Corpo da requisição em caso de POST, em caso de GET e DELETE são os parametros na url
        True,                       # Esse parametro é para saber se deseja executar o teste e gerar a saída, por 
                                    padrão passamos true
        True                        # esse paramentro é para se o teste já existir ao executar novamente será sobrescrito
                                    seus arquivos
    )
rasqc 0.0.4
Automated QA/QC for HEC-RAS Models.

# rasqc
Automated QA/QC checks on HEC-RAS models.

## Developer Setup
```
$ python -m venv venv-rasqc
```
```
$ source ./venv-rasqc/bin/activate
```
```
(venv-rasqc) $ pip install ".[dev]"
```
To run:
```
(venv-rasqc) $ python -m rasqc.main --help
```
lovethedocs 0.2.10
LLM-powered documentation tool
Requires Python: >=3.9

# lovethedocs

Polish your Python docs in 30 seconds.

Make your docstrings excellent with a single command. It’s fast (~30s), cheap
(~10¢ for small repos), and non-destructive.

* **One‑command upgrades** – `lovethedocs update path/`
* **Choose your style** – `NumPy` (default) or `Google` with `-s/--style`
* **Safe by defualt** – edits live in `path/.lovethedocs/` until you accept them
* **Parallel & fast** – set `-c/--concurrency` to speed things up

---

## Quick start

```bash
pip install lovethedocs

# 1. Get an OpenAI API key (https://platform.openai.com) and set it:
export OPENAI_API_KEY=sk-...

# 2. Stage docstrings for your project (NumPy style):
lovethedocs update path/to/project/

# ...or choose Google style and review in one shot with 8 workers:
lovethedocs update -s google -r -c 8 path/to/project/
```

### Review & clean

```bash
lovethedocs review path/to/project/   # open diffs in your viewer
lovethedocs clean  path/to/project/   # wipe staged edits
```

Tested on macOS; supported diff viewers: `cursor`, `code`, `git`, `terminal`.
Help adding others is welcome!

## 🎯 Example

Before:

```python
def process_data(data, threshold):
    # Process data according to threshold
    result = []
    for item in data:
        if item > threshold:
            result.append(item * 2)
    return result
```

After:

```python
def process_data(data: list, threshold: float) -> list:
    """
    Filter and transform data based on a threshold value.

    Parameters
    ----------
    data : list
        The input data list to process.
    threshold : float
        Values above this threshold will be processed.

    Returns
    -------
    list
        A new list containing doubled values of items that exceeded the threshold.
    """
    result = []
    for item in data:
        if item > threshold:
            result.append(item * 2)
    return result
```

### CLI cheatsheet

| Goal                    | Command                                          |
|-------------------------|--------------------------------------------------|
| Update and review       | `lovethedocs update -r my_module.py`             |
| Use Google style        | `lovethedocs update -s google path/`             |
| Speed up (16 workers)   | `lovethedocs update -c 16 path/`                 |
| Force terminal diff     | `lovethedocs review -v terminal path/`           |

---

## Contributors welcome

Issues, discussions, and PRs are encouraged—especially new doc styles, diff viewers, or
provider integrations. Open an issue to get started.

---

*lovethedocs is free to install; LLM calls are billed by OpenAI at your usage rates.*

## 📄 License

This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file
for details.
git-timespent 0.1.0
Estimate worked hours per author in a git repository.
Requires Python: >=3.6

# git-timespent
Estimate worked hours per author in a git repo. Python 3, no dependencies.

## Installation

```bash
pip install git-timespent
```

## Usage

```bash
# defaults to current directory
$ python -m timespent
#  1. Giovanni Paolo                35m51s (   7 commits)

# or specify a path and number of authors
$ python -m timespent /tmp/numpy -k 5
#  1. Charles Harris                  5w3d (7030 commits)
#  2. Travis Oliphant                2w22h (2047 commits)
#  3. Eric Wieser                    1w12h (1288 commits)
#  4. Pearu Peterson                  1w3h (1126 commits)
#  5. Mark Wiebe                     5d15h ( 798 commits)
```