semvec/pypi-packages huggingface dataset:
qnt-funcs 0.1.2
Advanced tools for Python error handling and syntax correction
Requires Python: >=3.6
Keywords: error handling, syntax correction, debugging, development tools

# Python Error Handling and Syntax Correction Tools

This repository contains advanced tools for Python error handling and syntax correction, designed to make Python development more efficient and user-friendly.

## Components

### 1. Decoher - Interactive Error Handling

Decoher provides interactive error handling capabilities for Python, allowing you to fix runtime errors on the fly without restarting your application.

#### Key Features

- ✅ Interactive error correction at runtime
- 🔄 Multiple correction options (fix single line, multiple lines, rewrite functions)
- 📝 Error fix history tracking
- 🛠️ Support for various error types (TypeError, NameError, IndexError, etc.)
- 🔌 Simple enable/disable functionality

#### Basic Usage

```python
import decoher

# Enable interactive error handling
decoher.enable()

# Your code with potential errors
# When an error occurs, you'll get an interactive prompt to fix it

# Disable when done
decoher.disable()

# View history of fixes
decoher.show_fix_history()
```

### 2. WaveGet - Automatic Syntax Error Correction

WaveGet extends Python with automatic syntax error correction capabilities, making code more resilient to common syntax mistakes.

#### Key Features

- 🔧 Automatic correction of common syntax errors
- 🐞 Enhanced debugging capabilities
- 🎓 Educational tool for learning proper syntax
- 🔄 Flexible usage in various contexts
- ⚙️ Customizable correction options

#### Basic Usage

```python
from wave_get import wave

# Enable WaveGet with debug mode
wave('enable', debug=True)

# Your code with potential syntax errors will now be automatically fixed

# Disable when done
wave('disable')
```

#### Syntax Errors Automatically Fixed

- Missing colons in control structures
- Missing commas in tuples and lists
- Missing parentheses in function calls
- List comprehension with missing brackets
- Indentation errors in function definitions

## Use Cases

### For Beginners
- 🔰 Learning Python with reduced frustration
- 🏫 Educational environments
- 💻 Interactive tutorials

### For Intermediate Users
- ⚡ Rapid prototyping
- 🔍 Debugging complex code
- 🧩 Code exploration

### For Advanced Users
- 🎬 Live coding demonstrations
- 👨‍🏫 Teaching and mentoring
- 🏛️ Legacy code maintenance

## Installation

```bash
pip install qnt_funcs
```

## Limitations

1. Not all errors can be fixed automatically
2. Automatic fixes might not always match programmer intent
3. Performance overhead during development
4. Best used in development and educational contexts, not production

## Best Practices

1. Use debug mode during development
2. Disable before deploying to production
3. Use as learning tools, not substitutes for proper coding practices
4. Combine with proper linting tools for comprehensive code quality
scientist-py 0.1.0
A lightweight async-compatible experiment framework for safely comparing candidate code paths to control logic.
Requires Python: >=3.8

# Scientist-Py

A lightweight, async-compatible Python port of GitHub's [Scientist](https://github.com/github/scientist) for testing candidate code paths against a control in production without affecting users.

## Features
- 🧪 Run control and candidate functions safely
- ⏱️ Measure execution time of each path
- ⚠️ Compare results and log mismatches
- ✅ Support for `async` functions
- 🎯 Sampling to control experiment frequency
- 🛡️ Ignore known exceptions
- 📊 Metric logging out-of-the-box

### What are Control and Candidate in Scientist?
    Control = The current, trusted, production logic.

    Candidate = The new or experimental logic you're testing against the control.

### Why use this?
It’s the safest way to test new implementations without breaking stuff. You can:

    Rewrite a function (e.g., old regex → new parser)

    Replace a service call (e.g., REST → GraphQL)

    Try a new algorithm or optimization

All while continuing to serve the real user with the proven control.

---

## Installation

Simply copy the `Experiment` class into your project. No external dependencies required.

---


## Usage

### Basic Example
```python
from experiment import Experiment

exp = Experiment("add-function")

@exp.control
def control():
    return 2 + 2

@exp.candidate
def candidate():
    return 2 + 2  # or some experimental logic

result = await exp.run()
```

### With `async` functions
```python
@exp.control
async def control():
    await asyncio.sleep(0.1)
    return 2 + 2

@exp.candidate
async def candidate():
    await asyncio.sleep(0.1)
    return 4
```

### Add a custom comparator
```python
exp.compare_with(lambda a, b: round(a, 2) == round(b, 2))
```

### Ignore known exceptions
```python
exp.ignore_exceptions(ValueError)
```

### Enable sampling (e.g. 10% of the time)
```python
exp.sample(0.1)
```

---

## Logging Output
When a mismatch is found, logs look like:
```
[Experiment: add-function] Mismatch detected!
 - Control result: 4
 - Candidate result: 5
[Experiment: add-function] Metrics:
 - Control duration: 0.000120 sec
 - Candidate duration: 0.000150 sec
 - Match: False
```

---

## License
MIT (or adapt as needed for internal tools)

---

## Inspired By
- [GitHub Scientist](https://github.com/github/scientist)
- [Scientist Ruby](https://github.com/github/scientist/blob/main/docs/scientist/README.md)

---

## TODO
- Persistent result storage (e.g., file/DB)
- Dashboard or reporting
- Integration with Prometheus or StatsD