semvec/pypi-packages huggingface dataset:
cheapi 0.1.0
Make API usage cheap! Caching wrapper for third party APIs.
Requires Python: >=3.8,<4.0

# Cheapi (cheap API) 

Lightweight wrapper to cache expensive function results in-memory or on disk.


## Installation

```bash
pip install cheapi
```

## Usage

```python
from cheapi import CachingWrapper
import openai


def _ask_chatgpt(prompt):
    res = openai.ChatCompletion.create(
        model="gpt-4",
        messages=[
            {"role": "system", "content": "You are a helpful assistant for a software engineer."},
            {"role": "user", "content": prompt}
        ],
        temperature=0,
        timeout=10,
    )
    choice, *_ = res["choices"]
    usage = res["usage"]["total_tokens"]
    print(f"OpenAI usage: {usage}")

    result = choice["message"]["content"]
    return result


ash_chatgpt = CachingWrapper(_ask_chatgpt, cache_backend="memory")

for i in range(2):
    print(ash_chatgpt("Write a short joke about caching?") + "\n")
```
or even simpler:
```python

from cheapi import cached

@cached(cache_backend="memory")
def ask_chatgpt(prompt):
    ...

for i in range(2):
    print(ask_chatgpt("Write a short joke about caching?") + "\n")
```

## Caching backends

Using memory backend is mostly equivalent to using `functools.lru_cache` but with more configuration.
SQLite backend is useful for persistent caching, and is similar to `joblib.Memory`.
Cloud backend is being dreamed of, but not implemented yet.

## Why? 

[NIH](https://en.wikipedia.org/wiki/Not_invented_here) + so I could [RIIR](https://www.urbandictionary.com/define.php?term=riir) later.
cinquis-util 0.0.6
Code Inquisitor Utilities
Requires Python: >=3.7

# cinquis-util
cinquis utilities repo
## Patch History
### 0.0.1 
untested build
### 0.0.2
cleand up code with pylint
### 0.0.3
renamed cinquis-util to cinquis_util due to package name requirements
### 0.0.4
renamed src/cinquis-util to src/cinquis_util and updated build files
### 0.0.5
updated text_analytics.py to import spacy
### 0.0.6
updated to use spacy current, removed some old spacy imports for cli
clip2classdist 0.1.0
A Python script that analyzes image classes using OpenAI CLIP model

# Clip2ClassDist

Clip2ClassDist is a Python script that analyzes image classes by leveraging OpenAI's CLIP model to generate image embeddings. It computes the center and radius of clusters formed by embeddings, the distribution of dot products within each class, and the average, minimum, and maximum dot products between different classes.

The script takes a list of image folders as input, with each folder representing a distinct image class. It uses the specified CLIP model to create normalized embeddings for each image in the folders. The script then analyzes the embeddings using the Faiss library for efficient similarity search and clustering.

## Installation

Clone the repository:

```bash
git clone https://github.com/ternaus/clip2classdist.git
```

Install the required dependencies:

```bash
pip install -r requirements.txt
```

## Usage

The main script compute.py can be executed with the following command:

```bash
Copy code
python clip2class_dist/compute.py --clip_model MODEL_NAME --image_folders CLASS_NAME_1 FOLDER_PATH_1 CLASS_NAME_2 FOLDER_PATH_2 [--device DEVICE]
```

Arguments:

* --clip_model: Name of the CLIP model to use (e.g., `ViT-B/32`). Where allowed models:
  * `ViT-B/32`
  * `RN50`
  * `RN101`
  * `RN50x4`
  * `RN50x16`
  * `ViT-B/16`
  * `RN50x64`
  * `ViT-L/14`
  * `ViT-L/14@336px`
* --image_folders: List of pairs containing class names and corresponding folder paths containing images. Each pair should be separated by a space, and pairs should be space-separated as well (e.g., "dogs /path/to/dog_images cats /path/to/cat_images").
* --device (optional): Device to run the model on (default: "cpu"). Set to "cuda" if you have a compatible GPU.

Example usage:

```bash
python clip2class_dist/compute.py --clip_model ViT-B/32 --image_folders dogs /path/to/dog_images cats /path/to/cat_images --device cpu
```

## Output

The script will output the following information:

1. Cluster centers for each class.
2. Cluster radii for each class.
3. Dot product distributions within each class.
4. Average dot product between different classes.
5. Minimum dot product between different classes.
6. Maximum dot product between different classes.

Example output:

```bash
Cluster centers: {'dogs': array([...]), 'cats': array([...])}
Cluster radii: {'dogs': 0.2384927, 'cats': 0.27184734}
Dot product distributions: {'dogs': array([...]), 'cats': array([...])}
Average dot product between classes: 0.19983745
Minimum dot product between classes: 0.01759241
Maximum dot product between classes: 0.38273957
```

## License

This project is released under the MIT License.
trimble-zebra-printing 1.0.1
Trimble Zebra Printing was built to simplify and standardize ZPL printing in the Trimble Facilities. This includes features, such as DPI scaling, to improve printing automation. Upscaling DPI results in a loss of quality. Matching DPIs or downscaling is recommended.
Requires Python: >=3.7

# Trimble Zebra Printing
Trimble Zebra Printing was built to simplify and standardize ZPL printing in the Trimble Facilities. This includes features, such as DPI scaling, to improve printing automation. Upscaling DPI results in a loss of quality. Matching DPIs or downscaling is recommended.

# class Trimble_Zebra
Class To Communicate & Print With (Zebra) Label Printers.

## def print_label(self, commands, queue = None):
Print Label Using ZPL Commands.

:param commands: ZPL command (string)

:param queue: printer queue (string) (optional)

## def get_queues(self):
Get Printer Queues.

:return: printer queues (list)

## def get_printer_dpi(self, queue = None):
Get Printer DPI.

:param queue: printer queue (string) (optional)

:return: printer DPI (int)

## def get_label_dpi(self, commands):
Get Label DPI.

:param commands: ZPL command (string)

:return: label DPI (int)

## def setup(self,label_height, label_width, direct_thermal = None):
Setup Printer Parameters Manually.

:param label_height: tuple (label height, label gap) (in dots)

:param label_width: label width (in dots)

:param direct_thermal: True if using direct thermal labels (bool) (optional)

## def autosense(self):
Autosense Label Parameters.

## def reset(self):
Reset Printer.

## def reset_default(self):
Reset Printer to Factory Default.