semvec/pypi-packages huggingface dataset:
black-forest-labs 1.0.0
Unofficial Black Forest Labs API client
Requires Python: >=3.8

# Black Forest Labs API Client

This is an unofficial Python client for interacting with the
[Black Forest Labs API](https://api.bfl.ml/).

```console
$ export BFL_API_KEY="..."
```

```python
import black_forest_labs
import time

task = black_forest_labs.generate(
    "flux-pro",
    prompt="ein fantastisches bild",
)

print(f"Task created with id `{task.id}`")

print("Polling for results...", end="", flush=True)
while not task.is_done:
    print(".", end="", flush=True)
    task = black_forest_labs.get_result(task.id)
    time.sleep(1)

print(f"\nTask finished with status `{task.status}`")
if task.result:
    print(f"Prompt: {task.result.prompt}")
    print(f"Image URL: {task.result.sample}")

```

<output>

```
Task created with id `ce9e065d-dc90-4633-9c1e-44ea839ed569`
Polling for results............
Task finished with status `Ready`
Prompt: ein fantastisches bild
Image URL: https://bflapistorage.blob.core.windows.net/public/db43e36806f74c1a9c6972127c9d71ea/sample.jpg
```

</output>
ALMAFE-Lib 0.0.17
Contains reusable tools which are required by other ALMAFE packages.
Requires Python: >=3.8

# ALMAFE-Lib package
Contains reusable tools which are required by other ALMAFE packages.

## ALMAFE.basic.ParseTimeStamp module

### class ParseTimeStamp:
Helper object for parsing time stamps in a variety of formats.
Caches last matching time stamp format string to speed subsequent calls.

### function makeTimeStamp(timeStamp = None):
initialized a timestamp from provided, or now() if None provided
:param timeStamp: string or datetime or None

## ALMAFE.basic.StripQuotes:
Utility to strip quotes from a string, if present.

## ALMAFE.basic.EnumHelper
Helper class for Enum and string conversion

## ALMAFE.basic.Units
Enum of widely-used engineering units

## ALMAFE.common.GitVersion:

### function gitVersion():
Return the current Git tag (if any) and revision as a string

### function gitBranch():
Return the current Git branch name as a string

## ALMAFE.database.DriverMySQL:

### class DriverMySQL():
Driver wrapper for mysql-connector-python
Provides a uniform interface to SQL user code

### class DriverSQLite():
Driver wrapper for sqlite3
Provides a uniform interface to SQL user code
maiden 0.2.4
A tool to generate Markdown files from templates populated with data from YAML or JSON files.
Requires Python: >=3.6

# MaiDEN

A command-line utility to generate Markdown files from templates populated with data from YAML or JSON files.

## Installation

\`\`\`bash
pip install maiden
\`\`\`

## Usage

\`\`\`bash
maiden templates/my_template.md output.md -d data.yaml
\`\`\`

```bash
Usage: maiden [OPTIONS] TEMPLATE_FILE OUTPUT_FILE

  CLI command to generate markdown from template

Options:
  -d, --data-file TEXT     Data files in YAML format
  --process-data-template  Process data file as a template
  --help
```

--process-data-template Option will process the data file as a template, so you can use Jinja2 syntax in your template file by using the updated data file.

So the idea will be using the template options in the data file so that it can collect information from files and then use this information in the template file with jinja2 syntax.

## Template Examples

### Read information from a file

Reading a field from a YAML or JSON file:
<% FROM additional_info.yml GET 'requirements' %>

Reading Python File Content
<% FROM src/exceptions.py GET 'content' %>

### Getting current time

<% DATE YYYY-MM-DD %>

### Getting information from OpenAI API
<% OPENAI
    Say something meaningful.
END %>

### Nested Usage
<% OPENAI
Read the following python codes and give me information about what STDOUT and STDERR are in a table.

just give me the information I asked, don't give information about what are you doing.

Action.py is like this
<% FROM src/actions/actions.py GET 'content' %>

Exceptions.py is like this
<% FROM src/exceptions.py GET 'content' %>

Extension.py is like this
<% FROM src/extension.py GET 'content' %>
END %>

### Jinja2 Template Engine
This tool also supports Jinja2 template engine, you can use it to generate more complex templates.
pyndeval 0.0.6
Interface to ndeval.c
Requires Python: >=3.6

# pyndeval

A python interface to TREC's `ndeval.c`, used for computing diversity retrieval metrics.

## Getting Started

From pip:

```bash
pip install pyndeval
```

Or install from source:

```bash
git clone https://github.com/seanmacavaney/pyndeval.git
cd pyndeval
python setup.py install
```

## Usage

```python
import pyndeval
from pyndeval import SubtopicQrel, ScoredDoc

# provide qrels as a list of tuples
qrels = [
    SubtopicQrel("0", "a", "A", 1),
    SubtopicQrel("0", "b", "B", 1),
    SubtopicQrel("0", "b", "D", 1),
    SubtopicQrel("0", "c", "C", 1),
]

# provide run as a list of tuples
run = [
    ScoredDoc("0", "A", 9.3),
    ScoredDoc("0", "D", 8.4),
    ScoredDoc("0", "E", 8.1), # not in qrels
    ScoredDoc("0", "B", 7.6),
    # C not retrieved
]

pyndeval.ndeval(qrels, run)
{'0': {
  'ERR-IA@5': 0.3933,
  'ERR-IA@10': 0.3907,
  'ERR-IA@20': 0.3907,
  'nERR-IA@5': 0.8297,
  'nERR-IA@10': 0.8297,
  'nERR-IA@20': 0.8297,
  'alpha-DCG@5': 0.4052,
  'alpha-DCG@10': 0.3998,
  'alpha-DCG@20': 0.3997,
  'alpha-nDCG@5': 0.7868,
  'alpha-nDCG@10': 0.7868,
  'alpha-nDCG@20': 0.7868,
  'NRBP': 0.3906,
  'nNRBP': 0.8620,
  'MAP-IA': 0.5000,
  'P-IA@5': 0.2000,
  'P-IA@10': 0.1000,
  'P-IA@20': 0.0500,
  'strec@5': 0.6666,
  'strec@10': 0.6666,
  'strec@20': 0.6666
}}
```

## Supported measures

`pyndeval` supports the following measures:

 - `ERR-IA@k`
 - `nERR-IA@k`
 - `alpha-DCG@k`
 - `alpha-nDCG@k`
 - `P-IA@k`
 - `strec@k`
 - `NRBP`
 - `nNRBP`
 - `MAP-IA`

Measures with `@k` support values from 1-20 (upper limit from `ndeval.c`).

Measures are provided as a list of strings with the `measures=` parameter.

```python
pyndeval.ndeval(qrels, run, measures=["ERR-IA@7", "MAP-IA"])
```

## Reusing qrels

If you're running multiple times for the same set of qrels and measures, you can speed it up by
building a `RelevanceEvaluator` object, which caches the internal qrel representations.

```python
ev = pyndeval.RelevanceEvaluator(qrels)
ev.evaluate(run1)
ev.evaluate(run2)
ev.evaluate(run3)
ev.evaluate(run4)
```

## Iterable results

```python
for result in pyndeval.ndeval_iter(qrels, run):
  {"query_id": "0", ...}
for result in ev.evaluate_iter(run):
  {"query_id": "0", ...}
```