semvec/pypi-packages huggingface dataset:
hawk-server 0.0.12
Utility function to perform the server-side of Hawk authentication
Requires Python: >=3.6.3

# hawk-server [![CircleCI](https://circleci.com/gh/uktrade/hawk-server.svg?style=shield)](https://circleci.com/gh/uktrade/hawk-server) [![Test Coverage](https://api.codeclimate.com/v1/badges/8bc445ea9d471b133b3f/test_coverage)](https://codeclimate.com/github/uktrade/hawk-server/test_coverage)

Utility function to perform the server-side of Hawk authentication, with no dependencies other than the Python standard library.


## Installation

```bash
pip install hawk-server
```


## Usage

```python
from hawkserver import authenticate_hawk_header

def lookup_credentials(id):
    # Return {'id': 'some-id', 'key': 'some-secret'} matching credentials,
    # or None if credentials can't be found

def seen_nonce(nonce, id):
    # Store nonce, return True if nonce previously seen

error_message, credentials = authenticate_hawk_header(
    lookup_credentials, seen_nonce, max_skew,
    header, method, host, port, path, content_type, content,
)
if error_message is not None:
    # Return error or raise exception as needed
```
hawk-server-asyncio 0.0.13
Utility function to perform the server-side of Hawk authentication for asyncio HTTP servers
Requires Python: >=3.6.3

# hawk-server-asyncio [![CircleCI](https://circleci.com/gh/uktrade/hawk-server-asyncio.svg?style=shield)](https://circleci.com/gh/uktrade/hawk-server-asyncio) [![Test Coverage](https://api.codeclimate.com/v1/badges/b03db2f3cb9fedeb4ea7/test_coverage)](https://codeclimate.com/github/uktrade/hawk-server-asyncio/test_coverage)

Utility function to perform the server-side of Hawk authentication for asyncio servers, with no dependencies other than the Python standard library.


## Installation

```bash
pip install hawk-server-asyncio
```


## Usage

```python
from hawkserver import authenticate_hawk_header

async def lookup_credentials(id):
    # Return {'id': 'some-id', 'key': 'some-secret'} matching credentials,
    # or None if credentials can't be found

async def seen_nonce(nonce, id):
    # Store nonce, return True if nonce previously seen

error_message, credentials = await authenticate_hawk_header(
    lookup_credentials, seen_nonce, max_skew,
    header, method, host, port, path, content_type, content,
)
if error_message is not None:
    # Return error or raise exception as needed
```
hpcheck 0.0.8
HTTP(S)代理验证工具
Requires Python: >=3.8

# hpcheck
_HTTP(S)代理验证工具_


## 安装
`pip3 install hpcheck`

## 使用
```
hpcheck proxyFile
```
会输出可用的代理地址  

## 代理格式
```
http://123.1.2.3:8080
https://123.1.2.3:8080
```
一行一个，仅支持http和https，但不支持使用认证

## 作为库使用
``` python
from hpcheck import check

porxyList = [
        "http://123.1.2.3:8080",
        "https://123.1.2.3:8080",
    ]

print(check(porxyList))
```
theano-hf 0.2.1
General purpose Hessian-free optimization in Theano
Requires Python: >=3.6

# Theano-hf-py3

This is a Python 3 verson of [boulanni/theano-hf](https://github.com/boulanni/theano-hf).

## Install

```bash
pip install --upgrade theano-hf
```

## Usage

```python
import theano_hf
```

## Original Description

I wrapped my Hessian-free code in a generic class, usable as a black-box to train your models if you can provide the cost function as a Theano expression.

It includes all the details in Martens (ICML 2010) and Martens & Sutskever (ICML 2011) crucial to make it work:

- Tikhonov damping with the Levenberg-Marquardt heuristics,
- Gauss-Newton matrix products (you specify an Theano expression `s` to section your computational graph in 2),
- Proper handling of batches and mini-batches (an example SequenceDataset class is provided for variable-length input)
- Conjugate gradient (CG) with information sharing, backtracking, preconditioning and terminations conditions.
- Structural damping for RNNs.

It relies heavily on the Rop. In practice, I could make it work without hassle for a feed-forward network, an RNN with different objectives, NADE (Larochelle) and a more complex model (RNN-NADE) that ties two scans together, so it seems reasonably flexible.
Only the gradients and Gauss-Newton matrix products (95% of the computation) are in Theano, CG and the training logic is in python. It runs on GPU, but for the models I tried, it was a bit slower.
Hessian-free is slow, you need CG batch sizes of 1000+ (don't skimp on this), but you can get really better results than SGD from it with almost zero tweaking.

There is an option to save and recover a checkpoint of training and do early stopping.

I included an RNN example that can memorize an input for 100 time steps (example_RNN). Launch it on 4 cores, come back in 8 hours, and you should have at least one nice solution with 0 error on the validation set.
In comparison, SGD can solve this problem about 0.0% of the time.

It is available here:
https://github.com/boulanni/theano-hf

If you use this software for academic research, please cite the following paper:

```
[1] N. Boulanger-Lewandowski, Y. Bengio and P. Vincent, "Modeling Temporal Dependencies in High-Dimensional Sequences: Application to Polyphonic Music Generation and Transcription", Proc. ICML 29, 2012.
```

Author: Nicolas Boulanger-Lewandowski
University of Montreal, 2012
pymachinery 0.1.3
Python workers for RichardKnop/machinery
Requires Python: >=3.6

# Machinery Python SDK

[PyPI](https://pypi.org/project/pymachinery/)

This is a subset Python implementation of a worker for `RichardKnop/machinery`.

## Limitations

- Broker is strictly only for Redis
- BackendResult is strictly only for MongoDB

## Development Environment

Use `venv` with python 3.

```shell
# ---- Setup
$ sudo apt install python3 python3-venv
$ python3 -m venv ~/.venv/simcel
# ---- Activate venv
$ source ~/.venv/simcel/bin/activate
(simcel) $ pip3 install -r requirements.txt
# ---- Running
(simcel) $ python3 main.py
```

## Usage

To start up machinery instance for Python:

```python
from machinery import Value, Machinery

def add(a: Value, b: Value):
    return (Value("int64", a.value() + b.value()))

def multiply(a: Value, b: Value):
    return (Value("int64", a.value() * b.value()))

def worker(name: Value, delayms: Value):
    return (
        Value("string", f"hello {name.value()}"),
        Value("int64", delayms),
    )

machinery = Machinery(
    broker_uri="redis://:helloworld@localhost:6379",
    backend_uri="mongodb://mongo:moonbucks@localhost:27017/?authSource=admin",
    queue="machinery_tasks",
)
machinery.register_callback("add", add)
machinery.register_callback("multiply", multiply)
machinery.register_callback("hello", worker)
# Note that start() is a blocking function.
machinery.start()
```

To send a machinery task and receive its results:

```python
task = machinery.send_task(queue, "add", [
    Value("int64", 30),
    Value("int64", 50)
])
# Note that wait_for_results() is a blocking function.
results = machinery.wait_for_results(task)
print(results)      # [ Value("int64", 80) ]
```

### Creating a Worker

Workers have these restrictions:

- Inputs should be of type pymachinery.Value
- Outputs should be of type pymachinery.Value, or a tuple of pymachinery.Value