<commit_before># coding: utf-8

"""
Python client for HTTP message queue [Queued](https://github.com/scttnlsn/queued).

Usage
-----

    >>> import pyqueued

Get a client.

    >>> client = pyqueued.Client(host='localhost', port=5353)

Enqueue a message:

    >>> loc = client.enqueue("q", "my message")
    >>> loc
    'http://localhost:5353/q/155'

Get the head of the queue. Without any timeout, the item is marked as completed when dequeued.

    >>> msg, loc = client.dequeue("q")
    >>> msg
    'my message'

THe queue is empty now, so another dequeue will fail:

    >>> msg, loc = client.dequeue("q")
    ...
    RuntimeError: dequeue failed: <Response [404]><commit_msg>update long description<commit_after># coding: utf-8

"""
Python client for HTTP message queue Queued: https://github.com/scttnlsn/queued.

Usage
-----

    >>> import pyqueued

Get a client.

    >>> client = pyqueued.Client(host='localhost', port=5353)

Enqueue a message:

    >>> loc = client.enqueue("q", "my message")
    >>> loc
    'http://localhost:5353/q/155'

Get the head of the queue. Without any timeout, the item is marked as completed when dequeued.

    >>> msg, loc = client.dequeue("q")
    >>> msg
    'my message'

THe queue is empty now, so another dequeue will fail:

    >>> msg, loc = client.dequeue("q")
    ...
    RuntimeError: dequeue failed: <Response [404]>
{'fraction_non_alphanumeric': 0.14985380116959066, 'fraction_numerical': 0.021929824561403508, 'mean_word_length': 3.1484848484848484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4162898', 'n_tokens_mistral': 465, 'n_tokens_neox': 435, 'n_words': 140}