semvec/pypi-packages huggingface dataset:
contract-attestation 0.2.0
Python SDK for on-chain smart contract attestation (ERC-8004)
Requires Python: >=3.11
Keywords: solidity, smart-contract, security, attestation, erc-8004, web3

# contract-attestation (Python SDK)

Python client for the Contract Attestation API — on-chain security attestation for smart contracts (ERC-8004).

## Install

```bash
pip install contract-attestation
# Optional crypto helpers
pip install "contract-attestation[crypto]"
```

## Development Install

```bash
pip install -e .
pip install -e ".[dev]"
# Optional crypto helpers while developing
pip install -e ".[dev,crypto]"
```

## Quickstart (async)

```python
from contract_attestation import AsyncClient

async def main() -> None:
    async with AsyncClient(api_key="your-key") as client:
        review = await client.review("contract C {}")
        print(review.score, review.evidence_level)
```

## Quickstart (sync)

```python
from contract_attestation import SyncClient

with SyncClient(api_key="your-key") as client:
    review = client.review("contract C {}")
    print(review.score, review.attestation_status)
```

## CI Gate

```python
from contract_attestation import GatePolicy, check_contract

policy = GatePolicy(min_score=80)
result = check_contract("contract C {}", api_key="your-key", policy=policy)
if not result.passed:
    raise SystemExit(1)
```

## Optional Crypto Helpers

```python
from contract_attestation import verify_response_hash, decrypt_findings

ok = verify_response_hash(ipfs_payload, on_chain_hash)
findings = decrypt_findings(ipfs_payload, private_key_hex)
```

## Manual Publish Fallback

```bash
pip install build twine
cd sdk/python
python -m build
TWINE_USERNAME=__token__ TWINE_PASSWORD="$PYPI_TOKEN" twine upload dist/*
```
temporal-random-walk 1.5.4
A library to sample temporal random walks from in-memory temporal graphs
Requires Python: >=3.8

# 🚀 Temporal Random Walk

[![PyPI Latest Release](https://img.shields.io/pypi/v/temporal-random-walk.svg)](https://pypi.org/project/temporal-random-walk/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/temporal-random-walk.svg)](https://pypi.org/project/temporal-random-walk/)

**A high-performance temporal random walk sampler for dynamic networks with GPU acceleration. Built for scale.**

---

## 🔥 Why Temporal Random Walk?
✅ **Performance First** – GPU-accelerated sampling for massive networks<br>
✅ **Memory Efficient** – Smart memory management for large graphs  
✅ **Flexible Integration** – Easy Python bindings with **NumPy/NetworkX** support  
✅ **Production Ready** – Tested with hundreds of extensive unit tests.<br>
✅ **Multi Platform** Builds and runs seamlessly on devices with or without CUDA.

---

## ⚡ Quick Start

```python
from temporal_random_walk import TemporalRandomWalk

# Create a directed temporal graph
walker = TemporalRandomWalk(is_directed=True, use_gpu=True, max_time_capacity=-1)

# Add edges - can be numpy arrays or python lists
sources = [3, 2, 0, 3, 3, 1]
targets = [4, 4, 2, 1, 2, 4]
timestamps = [71, 82, 19, 34, 79, 19]

walker.add_multiple_edges(sources, targets, timestamps)

# Sample walks with exponential time bias
walk_nodes, walk_timestamps, walk_lens = walker.get_random_walks_and_times_for_all_nodes(
    max_walk_len=5,
    walk_bias="ExponentialIndex",
    num_walks_per_node=10,
    initial_edge_bias="Uniform"
)
```

## ✨ Key Features
- ⚡ **GPU acceleration** for large graphs   
- 🎯 **Multiple sampling strategies** – Uniform, Linear, Exponential
- 🔄 **Forward & backward** temporal walks
- 📡 **Rolling window support** for streaming data
- 🔗 **NetworkX integration**
- 🛠️ **Efficient memory management**
- ⚙️ Uses **C++ std libraries** or **Thrust API** selectively based on hardware availability and configuration. 

---

## 📦 Dependencies

| Dependency     | Purpose                                     |
|---------------|---------------------------------------------|
| **pybind11**  | Python-C++ bindings                         |
| **python3**   | Required for building the python interfaces |
| **gtest**     | Unit testing framework                      |


> 💡 **Tip:** Use **vcpkg** to easily install and link the C++ dependencies.

---

## 📦 Installation

```sh
pip install temporal-random-walk
```

## 📖 Documentation

📌 **[C++ Documentation →](https://htmlpreview.github.io/?https://github.com/ashfaq1701/temporal-random-walk/blob/master/docs/html/classTemporalRandomWalk.html)**<br>
📌 **[Python Interface Documentation →](docs/_temporal_random_walk.md)**

---

## 📚 Inspired By

**Nguyen, Giang Hoang, et al.**  
*"Continuous-Time Dynamic Network Embeddings."*  
*Companion Proceedings of The Web Conference 2018.*

## 👨‍🔬 Built by [Packets Research Lab](https://packets-lab.github.io/)

🚀 **Contributions welcome!** Open a PR or issue if you have suggestions.
textpolicy 0.1.11
Reinforcement learning for text generation on MLX (Apple Silicon): GRPO/GSPO, environments, rollout, rewards, LoRA/QLoRA
Requires Python: >=3.12
Keywords: reinforcement-learning, text-generation, mlx, apple-silicon, lora, qlora, grpo, gspo, rlhf

# TextPolicy

Reinforcement learning toolkit for text generation on MLX (Apple Silicon).
TextPolicy provides algorithms (GRPO/GSPO), text-generation environments, a rollout runner,
reward functions with a decorator registry, and LoRA/QLoRA utilities.

## Install (uv)

```bash
uv add textpolicy
```

Optional model integration:

```bash
uv add mlx mlx-lm
```

## Quickstart

Working example using a real model and tokenizer (mlx-lm required):

```python
import mlx.core as mx
import textpolicy as tp
from textpolicy import load_model, create_policy
from textpolicy.environment.text_generation import TextGenerationEnv
from textpolicy.rollout import RolloutRunner, create_strategy

# 1) Load model and tokenizer (mlx-lm)
model, tokenizer = load_model("Qwen/Qwen3-0.6B")

# 2) Create a policy (controls generation)
generation_params = {"max_tokens": 25, "temperature": 0.7}
policy_fn = create_policy(model, tokenizer, generation_params)

# 3) Define a reward function (env uses this to score responses)
@tp.reward
def length_reward(prompt: str, completion: str, example: dict, **kwargs) -> float:
    return float(len(completion.split()))

# 4) Create an environment (requires a tokenizer)
env = TextGenerationEnv(["What is AI?"], length_reward, tokenizer=tokenizer)

# 5) Collect one rollout step
strategy = create_strategy('grpo')
runner = RolloutRunner(env, policy=policy_fn, strategy=strategy, max_steps=1)
buffer = runner.collect()
print(len(buffer.episodes))
```

Docs:
- Quickstart: `docs/QUICKSTART_UV.md`
- LoRA/QLoRA: `docs/10_lora_qlora.md`
- Full index: `docs/index.md`

FAQ:
- Do I need a model? 
    - Yes for generation with `create_policy`. 
    Use `load_model()` (mlx‑lm) to get `(model, tokenizer)`. 
    For reward‑only code (no generation), a model is not required.
- Do I need a tokenizer? 
    - Yes. 
    Both `TextGenerationEnv` and `TextGenerationEnvironment` require a tokenizer. 
    `load_model()` returns one for mlx‑lm models.
- How do I control generation? 
    - Pass `generation_params` to `create_policy` (for example, `max_tokens`, `temperature`, `top_p`, `repetition_penalty`).
- What does `step()` return? 
    - A dict with `observation`, `reward`, `terminated`, `truncated`, `info`. The runner enforces this.

Examples:
- 01–06: reward functions, batch processing, minimal training
- 08: GRPO training with rollout + buffer
- 09–10: length reduction (GRPO/GSPO)
- 11: LoRA/QLoRA configuration
- 12: TinyLoRA + GTPO + HICRA reasoning run (`experiments/countdown_reasoning_lora.py`)