semvec/pypi-packages huggingface dataset:
action-lipo 0.1.0
A lightweight post-optimizer for action chunks

# lipo
LiPo: A Lightweight Post-optimization Framework for Smoothing Action Chunks Generated by Learned Policies

## Installation
1. Clone the repository:
   ```bash
   git clone https://github.com/lab-dream/lipo.git
    ```

2. Navigate to the cloned directory:
    ```bash
    cd lipo
    ```

3. Install the package:
    ```bash
    pip install -e .
    ```

4. Visualize lipo:
    [lipo_visualization.ipynb](lipo_visualization.ipynb)
punigowdaa 0.1
A simple example package
Requires Python: >=3.6

# punigowda

🚀 A simple Python package to demonstrate how to create and publish your own Python package to PyPI.

This package provides sample GenAI program descriptions for educational or reference purposes.

## 📦 Installation

```bash
pip install punigowda

from punigowda import print_genai_programs
print_genai_programs(n) #where n is the number of program


create a file named.pypirc in home directory and paste the following code in it

[distutils]
index-servers =
    pypi

[pypi]
repository = https://upload.pypi.org/legacy/
username = __token__
password = api token of pypi.org
punigowda 0.2
A simple example package
Requires Python: >=3.6

# punigowda

🚀 A simple Python package to demonstrate how to create and publish your own Python package to PyPI.

This package provides sample GenAI program descriptions for educational or reference purposes.

## 📦 Installation

```bash
pip install punigowda

from punigowda import print_genai_programs
print_genai_programs(n) #where n is the number of program


create a file named.pypirc in home directory and paste the following code in it

[distutils]
index-servers =
    pypi

[pypi]
repository = https://upload.pypi.org/legacy/
username = __token__
password = api token of pypi.org
rememepy 0.1.4
A tool to substitute the main image in memes.
Requires Python: >=3.10

# rememepy
Rememepy is a simple tool to help you replace main images in memes.
```python
from rememepy import Generator
from PIL import Image

gen = Generator()
meme = gen.substitute("meme.jpg", "substitute.jpg")
meme.show()
```

## Features
### `substitute()` Function
The image substitution algorithm uses several adjustable parameters and returns a `PIL.Image.Image` object.

```python
def substitute(
    source_img_path: str,
    substitute_img_path: str,
    dominant_cluster_amount: int = 3,
    resize_to: tuple | None = None
) -> PIL.Image.Image
```
- `dominant_cluster_amount`: Controls the number of color clusters used to determine the dominant color in the image. Increasing this value can help identify the main image more precisely. If set to `0`, the dominant color is assumed to be white.
- `resize_to`: Optionally resizes the substitute image to the specified dimensions. If `None`, the substitute will be stretched to cover the target area.

### Validating Substitution Results
Some memes may cover the entire image area or contain multiple images, which can make substitution less accurate. To check whether the substitution was successful, call `validate_last_substitution()` after `substitute(...)`.
```python
def validate_last_substitution(
    threshold_min: float = 0.1,
    threshold_max: float = 0.9
) -> bool
```
- `threshold_min`: The minimum portion of the image the substitute should cover.
- `threshold_max`: The maximum portion of the image the substitute is allowed to cover.

### Foolproof Substitution
The `substitute_until_valid()` method automatically tries different combinations of parameters until a valid substitution is found or all options have been exhausted. If no valid result is found, it returns `None`.
```python
def substitute_until_valid(
    source_img_path: str,
    substitute_img_path: str,
    cluster_range: tuple = (0, 6)
) -> PIL.Image.Image | None
```
- `cluster_range`: A range of values for `dominant_cluster_amount` to try. A wider range increases the likelihood of success but also takes more time.

## Installing Rememepy and Supported Versions
Rememepy is available on [PyPi](https://pypi.org/project/rememepy/):
```console
$ python -m pip install rememepy
```
Rememepy officially supports Python 3.10+.
lxml-xpath-utils 0.1.1
A collection of utility functions for working with lxml and XPath.
Requires Python: >=2

A collection of utility functions for working with `lxml` and XPath.

Supports Python 2+.

## Functions

*   `inner_text(element: ElementBase) -> str`: Extracts the combined text content of an element and its descendants, like accessing JavaScript's innerText attribute.
*   `find_deepest_elements_containing_target_text(element: ElementBase, target_text: str) -> Iterator[ElementBase]`:  A generator that yields the deepest elements containing target text, starting from leaf nodes.
*   `get_xpath(element: ElementBase, relative_to: Optional[ElementBase] = None) -> str`:  Generates the absolute or relative XPath expression for a given `lxml` element.  If `relative_to` is specified, the XPath will be relative to that element.

## Usage

Here's a brief example of how to use the functions:

```python
from __future__ import print_function

from lxml import etree

from lxml_xpath_utils import inner_text, find_deepest_elements_containing_target_text, get_xpath

html = """<html>
    <body>
        <div id="main">
            <p>This is a paragraph with target text.</p>
            <div class="nested">
                <span>Some text here</span>
                <p>Another paragraph with target text in it.</p>
            </div>
            <p>No match here</p>
        </div>
        <div id="other">
            <p>target text appears again here</p>
        </div>
    </body>
</html>"""

target_text = "target text"

parser = etree.HTMLParser()
root = etree.fromstring(html, parser)

matching_elements = find_deepest_elements_containing_target_text(root, target_text)

print("Elements containing '%s':" % target_text)
for elem in matching_elements:
    absolute_xpath = get_xpath(elem)
    print(absolute_xpath)
    assert elem == root.xpath(absolute_xpath)[0]
    print("  Text: %s\n" % inner_text(elem))

print("Elements containing '%s' in /html/body/div[@id='main']:" % target_text)
new_root = root.xpath('/html/body/div[@id="main"]')[0]
new_matching_elements = find_deepest_elements_containing_target_text(new_root, target_text)

for new_elem in new_matching_elements:
    relative_xpath = get_xpath(new_elem, new_root)
    print(relative_xpath)
    assert new_elem == new_root.xpath(relative_xpath)[0]
    print("  Text: %s\n" % inner_text(new_elem))
```

Output:

```
Elements containing 'target text':
/html/body/div[1]/p[1]
  Text: This is a paragraph with target text.

/html/body/div[1]/div/p
  Text: Another paragraph with target text in it.

/html/body/div[2]/p
  Text: target text appears again here

Elements containing 'target text' in /html/body/div[@id='main']:
./p[1]
  Text: This is a paragraph with target text.

./div/p
  Text: Another paragraph with target text in it.

```

## Contributing

Feel free to contribute to this project by submitting pull requests or opening issues.

## License

This project is licensed under the [MIT License](LICENSE).