<commit_before>========
Examples
========
We present a set of examples that hopefully show how you can use Chains to build
flexible pipeline of streaming data.

packet_stream.py
================
Print packets is about the simplest chain you could have. It takes a stream_packet
source and prints out the packets. It's a 'sink' meaning that it
cannot be an input into another chain. 
stream_packets -> print_packet

.. automodule:: chains.print_packets

**Code Excerpt**

.. code-block:: python

    """Get a packet stream source and give it to print_packets :) """
    packet_stream = stream_packets.stream_packets(max_packets=10)
    print_packets(packet_stream)


**Example Output**

.. code-block:: json

    Timestamp:  2015-05-22 20:45:35.907100
    Ethernet Frame:  e4:f4:c6:06:b2:8d 6c:40:08:89:fc:08 2048
    IP: 192.168.3.11 -> 192.168.1.9   (len=494 ttl=52 DF=1 MF=0 offset=0)

    Timestamp:  2015-05-22 20:45:35.907155
    Ethernet Frame:  6c:40:08:89:fc:08 e4:f4:c6:06:b2:8d 2048
    IP: 192.168.1.9 -> 192.168.3.11   (len=52 ttl=64 DF=1 MF=0 offset=0)

    Timestamp:  2015-05-22 20:45:35.907290
    Ethernet Frame:  6c:40:08:89:fc:08 e4:f4:c6:06:b2:8d 2048
    IP: 192.168.1.9 -> 192.168.3.11   (len=190 ttl=64 DF=1 MF=0 offset=0)
<commit_msg>fix example doc<commit_after>========
Examples
========
We present a set of examples that hopefully show how you can use Chains to build
flexible pipelines of streaming data.

print_packets.py
================
Print packets is about the simplest chain you could have. It takes a stream_packet
source and prints out the packets. It's a 'sink' meaning that it
cannot be an input into another chain. 

stream_packets -> print_packet

.. automodule:: chains.print_packets

**Code Excerpt**

.. code-block:: python

    """Get a packet stream source and give it to print_packets :) """
    packet_stream = stream_packets.stream_packets(max_packets=10)
    print_packets(packet_stream)


**Example Output**

.. code-block:: json

    Timestamp:  2015-05-22 20:45:35.907100
    Ethernet Frame:  e4:f4:c6:06:b2:8d 6c:40:08:89:fc:08 2048
    IP: 192.168.3.11 -> 192.168.1.9   (len=494 ttl=52 DF=1 MF=0 offset=0)

    Timestamp:  2015-05-22 20:45:35.907155
    Ethernet Frame:  6c:40:08:89:fc:08 e4:f4:c6:06:b2:8d 2048
    IP: 192.168.1.9 -> 192.168.3.11   (len=52 ttl=64 DF=1 MF=0 offset=0)

    Timestamp:  2015-05-22 20:45:35.907290
    Ethernet Frame:  6c:40:08:89:fc:08 e4:f4:c6:06:b2:8d 2048
    IP: 192.168.1.9 -> 192.168.3.11   (len=190 ttl=64 DF=1 MF=0 offset=0)

{'fraction_non_alphanumeric': 0.14444444444444443, 'fraction_numerical': 0.15555555555555556, 'mean_word_length': 3.8110687022900764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, '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': '3345897', 'n_tokens_mistral': 1216, 'n_tokens_neox': 963, 'n_words': 264}