semvec/pypi-packages huggingface dataset:
jinja-gen 1.6.0
Generate script files from easy configs
License: MIT

# Jinja Generator

[![Build Status](https://travis-ci.com/activatedgeek/jinja-gen.svg?branch=master)](https://travis-ci.com/activatedgeek/jinja-gen)
[![PyPI version](https://badge.fury.io/py/jinja-gen.svg)](https://pypi.org/project/jinja-gen/)
![Project Status](https://img.shields.io/badge/status-stable-brightgreen.svg)

## Installation

### From PyPI Repository

```shell
$ pip install jinja-gen
```

### From Source

```shell
$ pip install -U .
```

## Usage

```
usage: jinja-gen [-h] [-f] [-c] [-o] [--dry] [-k] [-d] [--debug] [--exec]
              [--no-dump]

Jinja Generator

optional arguments:
  -h, --help            show this help message and exit
  -f , --file           Path to the Jinja2 template file
  -c , --config         Path to the YAML configuration file, defaults to
                        <file_basename>.yaml
  -o , --output-dir     Output directory for generated files, defaults to
                        configuration file name
  --dry                 A dry run showing files to be generated
  -k , --output-name-key 
                        An extra key identifier populated for template with
                        name
  -d , --output-dir-key 
                        An extra key identifier populated for template with
                        output directory
  --debug               Enable debugging
  --exec                Enable executable file outputs
  --no-dump             Flag to disable a deterministic dump of the
                        configuration file
```

## Examples

See sample files in [examples](./examples) folder.

```
$ jinja-gen -f examples/sample.sh -c examples/sample.yaml
```

To enable executable file outputs,

```
$ jinja-gen -f examples/sample.sh -c examples/sample.yaml --exec
```

# License

MIT
prob-phoc 0.2.0
Functions to compute probabilistic relevance scores from PHOC embeddings
License: MIT

# prob-phoc

[![Build Status](https://travis-ci.com/jpuigcerver/prob-phoc.svg?branch=master)](https://travis-ci.com/jpuigcerver/prob-phoc)

PyTorch functions to compute meaningful probabilistic relevance scores from
PHOC (Pyramid of Histograms of Characters) embeddings.
Although they are called Pyramid of Histograms of Characters, in practice
they are a Pyramid of Bag of Characters. At the end, each word is
represented by a high-dimensional binary vector.

See the [wiki](https://github.com/jpuigcerver/prob-phoc/wiki)
for additional details.

## Usage

The library provides two functions: `cphoc` and `pphoc`, which are
similar to SciPy's `cdist` and `pdist`:

Both functions can operate with PHOC embeddings in the probability space (where
each dimension is a real number in the range [0, 1]), or in the log-probability
space (where each dimension is the logarithm of a probability). These are also
sometimes refered to as the Real and Log semirings.

```python
import torch
from prob_phoc import cphoc, pphoc

x = torch.Tensor(...)
y = torch.Tensor(...)

# Compute the log-relevance scores between all pairs of rows in x, y.
# Note: x and y must have the PHOC log-probabilities.
logprob = cphoc(x, y)

# This is equivalent to:
logprob = cphoc(x, y, method="sum_prod_log")

# If your matrices have probabilities instead of log-probabilities, use:
prob = cphoc(x, y, method="sum_prob_real")

# Compute the log-relevance scores between all pairs of distinct rows in x.
# Note: The output is a vector with N * (N - 1) / 2 elements.
logprob = pphoc(x)
```

## Installation

The easiest way is to install the package from PyPI:

```bash
pip install prob-phoc
```

If you want to install the latest version from the repository, clone it
and use the setup.py script to compile and install the library.

```bash
python setup.py install
```

You will need a C++11 compiler (tested with GCC 4.9).
If you want to compile with CUDA support, you will also need to install
the CUDA Toolkit (tested with versions 8.0, 9.0 and 10.0)

## Tests and benchmarks

After the installation, you can run the tests to ensure that everything is
working fine.

```bash
python -m prob_phoc.test
```

I have also some benchmarks to compare CPU vs. CUDA, for different matrix
sizes and float precision. These take quite a long to run, so don't hold
your breath.

```bash
python -m prob_phoc.benchmark
```
jsoncomment 0.4.2
A wrapper to JSON parsers allowing comments, multiline strings and trailing commas
License: MIT
Requires Python: >=3.3
Keywords: json comments multiline

Json Comment
============

A wrapper to JSON parsers allowing comments, multiline strings and trailing commas

- - -

Dependencies
------------

* Python 3.3+
* TODO NEW ADDITIONS

### Optional

* ujson 1.30+

- - -

Description
-----------

JSON Comment allows to parse JSON files or strings with:

* Single and Multi line comments
* Multi line data strings
* Trailing commas in objects and arrays, after the last item

This package works with any JSON parser which supports:

* `load(fp, ...)` to parse files
* `loads(s, ...)` to parse strings

by adding a preprocessor to these calls.

- - -

### Comments

* `#`, `;` and `//` are for single line comments
* `/*` and `*/` enclose multiline comments

Inline comments are **not** supported

- - -

### Multiline strings

Any string can be multiline, even object keys.

* Multiline strings start and end with `"""`, like in python
* The preprocessor merges all lines to a single JSON standard string
* A single trailing space per line is kept, if present
* New line is not kept. To hard code new lines in the string, use `\\n`

- - -

Custom Methods
--------------

### File Load

`loadf(path, *args, default = None, **kwargs)`

Opens a JSON file with comments. Allows a default value if loading or parsing fails

### File Save

`dumpf(json_obj, path, *args, indent=4, **kwargs)`

Saves a JSON file with indentation

- - -

Install
-------

`pip install jsoncomment`

OR

* Download source
* `python setup.py install`

- - -

Usage
-----

	from jsoncomment import JsonComment

	string = "[]"
	json = JsonComment()
	json_obj = json.loads(string)

### Examples

Added in the /examples directory

- - -

### Limitations

* `#`, `;`, `//` and `/*` may be preceded only by whitespaces or tabs on the same line
* `*/` may be followed only by whitespaces or tabs on the same line
* The trailing comma must be the last character on the same line

- - -

Source
------

[Source](https://bitbucket.org/Dando_Real_ITA/json-comment/src/default)
code available with MIT license on Bitbucket.

- - -

API
---

Added in top level `__init__.py`

### How to read the API

API is split in:

	* `User Interface` for common use
	* `Developer Interface` exposing some internals that could be useful

For each item ( function or class ), there are 2 blocks of comments, above and below item definition:

	* The top describes the return values
	* The bottom describes the item and call variables

If call variables have defaults or use duck typing, every allowed value is described

Example:

	# return_value
		# description
	from .some_module import SomeClass
		# SomeClass description
	# (
		# variable_1,
			# description
		# variable_2 = something,
			# description

			# = Default
				# description of default value ( something )
			# = something_2
				# description of alternate form ( duck typing )
	# )

describes `return_value = SomeClass(variable_1, variable_2 = current_value)`

- - -

Contact
-------

Gaspare Iengo @ [email](mailto:gaspareiengo@gmail.com)