<commit_before>coils
=====

.. image:: https://api.travis-ci.org/vmlaker/coils.png
  :alt: Build Result Image
  :target: https://travis-ci.org/vmlaker/coils

Some of my miscellaneous codes. Written in 100% pure Python.

Test the codes by running:
::

  nosetests<commit_msg>Add different usage scenarios.<commit_after>coils
=====

.. image:: https://api.travis-ci.org/vmlaker/coils.png
  :alt: Build Result Image
  :target: https://travis-ci.org/vmlaker/coils

Some of my miscellaneous, 100% pure Python codes.

coils is written so you can use it as a Python module 
in your own project's source tree. Simply clone
the repo wherever you see fit:
::
  
  git clone http://github.com/vmlaker/coils

Or, if you're inside your own Git repo, you might 
prefer to clone coils as a Git submodule instead:
::

  git submodule add http://github.com/vmlaker/coils

Now you're ready to rock:
::

  python
  >>> import coils
  >>> r = coils.RateTicker((1, 5, 15))
  >>> r.tick()
  (1.0, 0.2, 0.06666666666666667)

If you can't (or just don't want to) use the name "coils",
you're free to call it whatever you want, no problem:
::

  git submodule add http://github.com/vmlaker/coils other/stuff/swirly
  touch other/__init__.py
  touch other/stuff/__init__.py
  python
  >>> from other.stuff import swirly
  >>> a = swirly.Averager(2)  # Average of last 2 values
  >>> a.add(1.0)
  1.0
  >>> a.add(2.0)
  1.5
  >>> a.add(3.0)
  2.5
{'fraction_non_alphanumeric': 0.1331923890063425, 'fraction_numerical': 0.03241719520789288, 'mean_word_length': 3.3962848297213624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '4167737', 'n_tokens_mistral': 554, 'n_tokens_neox': 512, 'n_words': 161}