semvec/pypi-packages huggingface dataset:
decorate-all 0.1.1
Apply a decorator to all functions in a module.

# Py-Decorate-All

Apply a decorator to all functions in a module.

## Installation
```sh
pip install decorate-all
```

## Example Usage

```python
from decorate_all import decorate_all_functions
decorate_all_functions(my_decorator, my_module)
```

decorator (function): the decorator to apply to functions
module_name (string): the name of the module to apply the decorator to

If you want to apply the decorator to functions in the current module, pass `__name__` the module as make sure to call `decorate_all_functions` after defining the functions to decorate, i.e. at the end of the script to apply to all functions.

Here is an example for applying a decorator to all functions in a script:
_(works in a module or interactive console (REPL))_

```python
from decorate_all import decorate_all_functions

def test_function():
    print("Hello there")


def demo_decorator(func):
    def wrapper(*args, **kwargs):
        result = func(*args, **kwargs)
        return "Decorator was here!"
    
    return wrapper

decorate_all_functions(demo_decorator, __name__)

print(test_function())
```

The output of the above code is:
```
Hello there
Decorator was here!
```
jsonrpc-python-client-generator 1.0.3
Jsonrpc Python Client Generator
Requires Python: >=3.10
Keywords: jsonrpc 2.0 python client generator

# Jsonrpc Python Client Generator

## Installation

```bash
pip install jsonrpc-python-client-generator
```

## Getting started

Create file `generate.py` with code:
```python
import sys, os

from jsonrpc_python_client_generator.generator import ClientGenerator

openRpcFile = '';
clientFile = '';

for i in range(len(sys.argv)):
    if sys.argv[i] == "--schema":
        openRpcFile = sys.argv[(i+1)]
    if sys.argv[i] == "--output":
        clientFile = sys.argv[(i+1)]

if (os.path.isfile(clientFile)):
    raise SystemExit("Output file is already exists: " + clientFile)

if (os.path.isfile(openRpcFile) == False):
    raise SystemExit("OpenRpc file does not exist: " + openRpcFile)

with open(openRpcFile) as f: schema = f.read()

generator = ClientGenerator(schema=schema,output=os.path.abspath(clientFile))
generator.run()
```

Than run script from command line:
```bash
python ./generate.py --output ./output/client.py --schema ./schema/onenrpc.json 
```
where:
 * --schema is path to OpenRPC schema file
 * --output is output file

 ## How to use client class

Put output file with client class in your project. Make import and than use the instance of this class.
For example:
```pyton
from client import JsonRpcClient

client = JsonRpcClient()
client.checkLogin(login="your_login")
```

## Requirements
 * Python 3.10 and higher
notifylib 0.0.2
notify users
Requires Python: >=3.6

# pytest cache directory #

This directory contains data from the pytest's cache plugin,
which provides the `--lf` and `--ff` options, as well as the `cache` fixture.

**Do not** commit this to version control.

See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information.
whiscy 1.2.0
WHISCY is a software that predicts protein-protein interfaces using conservation and structural information by calculating prediction scores for each surface residue based on sequence alignment.
Requires Python: <4.0,>=3.11

# WHISCY - WHat Information does Surface Conservation Yield?

[![ci](https://github.com/haddocking/whiscy/actions/workflows/test.yml/badge.svg)](https://github.com/haddocking/whiscy/actions/workflows/test.yml)

![WHISCY](media/whiscy_logo.png)

**WHISCY is a program to predict protein-protein interfaces.**

It is primarily based on conservation, but it also takes into account structural information. A sequence alignment is used to calculate a prediction score for each surface residue of your protein.

This repository contains an updated version of WHISCY. The original code was published in the following paper:

- de Vries, S. J., van Dijk, A. D. J. & Bonvin, A. M. J. J. [WHISCY: What information does surface conservation yield? Application to data‐driven docking.](https://doi.org/doi:10.1002/prot.20842) Proteins: Structure, Function, and Bioinformatics vol. 63 479–489 (2006).

## Table of contents

- [How does WHISCY work?](#how-does-whiscy-work)
- [Installation](#installation)
- [Usage](#usage)

## How does WHISCY work?

WHISCY requires a protein structure and a sequence alignment. First, it identifies a master sequence, the sequence that best matches the structure.

The sequence distance (amount of mutation) between the master sequence and all sequences is estimated. This determines the amount of expected mutation.

Then, for each residue, the expected mutation is compared with the observed mutation. Less change than expected means conservation, translated into a positive WHISCY score.

![compare](media/compare.jpg)

Next, the interface propensity is taken into account.

Phenylalanines, for example, are likely to be in a protein-protein interface, so all phenylalanines receive a higher score. Lysines are much less likely to be in a protein-protein interface, so lysines receive a lower score.

Finally, all scores are smoothed over the surface of the protein structure.

Interfaces often form patches, so that neighbours of interface residues often are interface residues, too. The smoothing means that the scores of these neighbours are taken into account.

![interface](media/interface.jpg)

## Installation

Please refer to [INSTALLATION.md](INSTALLATION.md) for a detailed guide on how to install WHISCY in macOS and GNU/Linux.

## Usage

Check [USAGE.md](USAGE.md) to learn how to use WHISCY to predict protein-protein interfaces.
sqlgym 0.1.2
SQLGym: A portable Gymnasium environment of SQLite database.
Requires Python: >=3.8

# SQLGym

This is a portable Gymnasium environment of SQLite database. It is designed for platforms that are not able to use docker. (e.g. users without root privillege)

## Setup

Simply `pip install sqlgym`. If you want to generate ReAct dataset and fine tune a model, please clone the repository and install from source.

```bash
# Clone this repository
git clone https://github.com/KYLN24/sqlgym.git
# or via SSH
# git clone git@github.com:KYLN24/sqlgym.git

cd sqlgym

# Install this package
pip install ".[sft]"
```

## Prepare Dataset

```
# Make a directory to save data
mkdir .data
cd .data
```

This project currently suppport the BIRD-SQL dataset.

```bash
mkdir bird
cd bird

# Download BIRD-SQL Dataset
wget -c https://bird-bench.oss-cn-beijing.aliyuncs.com/train.zip
unzip train.zip
cd train
unzip train_databases.zip
cd ..

wget -c https://bird-bench.oss-cn-beijing.aliyuncs.com/dev.zip
unzip dev.zip
cd dev
unzip dev_databases.zip
cd ..
```

# Usage

```python
from sqlgym import SqlGymEnv
from sqlgym.datasets import BirdDataset

dataset = BirdDataset(
    bird_path=".data/bird",
    mode="dev",
)

env = SqlGymEnv(dataset)

print(env.reset(0))
print(env.step(dataset[0].gt))
```

# SFT

You can use `scripts/make_datasets.py` to generate a SFT dataset.

```bash
python -u scripts/make_datasets.py --bird_path=./data/bird # Dataset will be created at ./data/bird/train.jsonl and ./data/bird/dev.jsonl
```

You can use `scripts/make_react_dataset.py` to convert it to ReAct format with thought generated by GPT.

```bash
# Edit the script to add your OpenAI api_key.
# Change base_url and other generation parameters as you wish.
python -u scripts/make_react_dataset.py \
       --data_path=.data/bird/train.jsonl \
       --save_path=.data/bird/train_react.jsonl
```

Then, use `scripts/train.py` or `scripts/train_react.py` to fine tune a chat model. The tokenizer should support the `apply_chat_template` method.

```bash
torchrun --nproc_per_node=8 scripts/train.py \
         --model=meta-llama/Llama-2-7b-chat-hf \
         --train_set=.data/bird/train.jsonl \
         --output_dir=.data/output

torchrun --nproc_per_node=8 scripts/train.py \
         --model=meta-llama/Llama-2-7b-chat-hf \
         --train_set=.data/bird/train_react.jsonl \
         --output_dir=.data/output \
         --react
```