semvec/pypi-packages huggingface dataset:
hippo2client 1.6
Client Adapter to Hippo2D
License: MIT

# Hippo2client

## Installation

Simple install this module via pip (pip for Python 2 is also supported)

```
pip3 install --user hippo2client
```


## Usage

```
import hippo2client

# shorten git id is perfect, better then tags, because tags
# may not available everywhere to identify a version always
e = hippo2client.MajorEntity('72a56cd05b')

# there is a concept of an alias, this can make the git id
# more obvisious (this can be the output of git describe --always
# --dirty
e.set_alias('v1.5')

e.add_markdown('001', '# Heading - First Level')
e.add_markdown('002', '## Sub Heading - First Level')
e.add_markdown('003', '[link to second level (0001)](0001/)')
e.add_file("graph.png", path_to_image)
e.add_markdown('100', '![graph](graph.png)')

# second level
e.add_markdown('0001/001', '# Heading - Second Level')
e.add_markdown('0001/002', '## Sub Heading - Second Level')
e.add_markdown('0001/003', '[link to third level (0001)](0001/)') # note here, this is already relativ to 0001!
e.add_markdown('0001/004', '[level up link (0001)](..)')
e.add_file("0001/graph.png", path_to_image)
e.add_markdown('0001/100', '![graph](graph.png)')

# third level
e.add_markdown('0001/0001/001', '# Heading - Third Level')
e.add_markdown('0001/0001/002', '## Sub Heading - Third Level')
e.add_markdown('0001/0001/003', '[link to fourt level (0001)](0001/)') # note here, this is already relativ to 0001/0001!
e.add_markdown('0001/0001/004', '[level up link (0001)](..)') # note here, this is already relativ to 0001/0001!
e.add_file("0001/0001/graph.png", path_to_image)
e.add_markdown('0001/0001/100', '![graph](graph.png)')

# Fourth level
e.add_markdown('0001/0001/0001/001', '# Heading - Fourth Level')
e.add_markdown('0001/0001/0001/002', '## Sub Heading - Fourth Level')
e.add_markdown('0001/0001/0001/003', '[link to Fifth level (0001)](0001/)') # note here, this is already relativ to 0001/0001!
e.add_markdown('0001/0001/0001/004', '[level up link (0001)](..)') # note here, this is already relativ to 0001/0001!
e.add_file("0001/0001/0001/graph.png", path_to_image)
e.add_markdown('0001/0001/0001/100', '![graph](graph.png)')

# Fifth level
e.add_markdown('0001/0001/0001/0001/001', '# Heading - Fifth Level')
e.add_markdown('0001/0001/0001/0001/002', '## Sub Heading - Fifth Level')
e.add_markdown('0001/0001/0001/0001/003', 'Should be enough ...')
e.add_file("0001/0001/0001/0001/graph.png", path_to_image)
e.add_markdown('0001/0001/0001/0001/100', '![graph](graph.png)')
e.set_test_status('0001/0001/0001/0001', "passed")


URL = "http://localhost:8080/"
TIMEOUT = 10
a = hippo2client.Agent(url=URL, timeout=TIMEOUT)
a.add(e)
a.upload()
```
choke 0.1.2
choke: simple implementation of throttling mechanism.
License: MIT
Keywords: throttling redis limit

choke: simple implementation of throttling mechanism
====================================================

|License: MIT| |Build Status|

**choke** is a package implementing a trivial to use general purpose throttling mechanism. The basic workflow with **choke** is as follows:

1. Create manager - an object responsible for keeping track of timestamps when some events (think: calls to your functions) occur.
2. Instruct manager to "choke" some callables, i.e. define maximum number of calls that can occur per given time window.
3. Use your callables as usual, keeping in mind that when the above defined limit is exceeded, the choked callable will raise `CallLimitExceededError`.

Here is an example containing everything you need to use **choke**:

.. code:: python

    from time import sleep
    from redis import StrictRedis
    from choke import RedisChokeManager, CallLimitExceededError

    REDIS = StrictRedis() # Tweak this to reflect your setup            
    CHOKE_MANAGER = RedisChokeManager(redis=REDIS)

    # Example configuration: enforce limit of no more than 10 calls in two seconds window
    @CHOKE_MANAGER.choke(limit=10, window_length=2)
    def foo(x, y):
        """Just print something to show that foo was called."""
        print(f'foo called with ({x}, {y})')

    if __name__ == '__main__':
        # We expect pattern of 10 successes followed by 10 failures followed again by 10 successes
        # Some deviations from this pattern may obviously occur as calling foo takes nonzero time
        for i in range(30):
            try:
                foo(i, y=i ** 2)
            except CallLimitExceededError:
                print('Foo not called. Limit exceeded!')
            sleep(0.1)


.. |License: MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
   :target: https://opensource.org/licenses/MIT
.. |Build Status| image:: https://travis-ci.org/dexter2206/choke.svg?branch=master
   :target: https://travis-ci.org/dexter2206/choke