<commit_before>#!/usr/bin/python

class AnsiGenerator(object):
  """
  AnsiGenerator - Dirt-simple class for generating strings with ANSI
  terminal escape codes.
  
  Usage:

  # Create a AnsiGenerator object
  ag = AnsiGenerator()

  # Produce and print some colored strings.  Combine attributes
  # by chaining them together.  Pass a string to the last
  # attribute to get the printable string:
  print ag.faint.on_blue.red("This is red text")
  print ag.bold.underline('foo')

  # Note you must pass the string to the last call in the chain.
  # This is right out and will produce an AttributeError:
  print ag.bold("My string").underline

  # You can also pre-create an AnsiGenerator with certain attributes.
  # Just don't pass a string to the last attribute and you will get
  # an AnsiGenerator loaded with those attributes
  bup = ag.bold.underline

  # AnsiGenerator objects are callable.  Just call it and pass the string
  # you want to print
  print bug('This is a test in bold underline')

  # or stack more attributes on it
  print bug.red('This is a test in bold underlined red')

  """
  ESCAPE = chr(033)
  ATTRS = {
     'clear':        0,
     'reset':        0,
     'bold':         1,
     'dark':         2,
     'faint':        2,
     'underline':    4,
     'underscore':   4,
     'blink':        5,
     'reverse':      7,
     'concealed':    8,
     'black':   30,   'on_black':    40,<commit_msg>Mention source of ansigenerator control codes<commit_after>#!/usr/bin/python

class AnsiGenerator(object):
  """
  AnsiGenerator - Dirt-simple class for generating strings with ANSI
  terminal escape codes.
  
  Usage:

  # Create a AnsiGenerator object
  ag = AnsiGenerator()

  # Produce and print some colored strings.  Combine attributes
  # by chaining them together.  Pass a string to the last
  # attribute to get the printable string:
  print ag.faint.on_blue.red("This is red text")
  print ag.bold.underline('foo')

  # Note you must pass the string to the last call in the chain.
  # This is right out and will produce an AttributeError:
  print ag.bold("My string").underline

  # You can also pre-create an AnsiGenerator with certain attributes.
  # Just don't pass a string to the last attribute and you will get
  # an AnsiGenerator loaded with those attributes
  bup = ag.bold.underline

  # AnsiGenerator objects are callable.  Just call it and pass the string
  # you want to print
  print bug('This is a test in bold underline')

  # or stack more attributes on it
  print bug.red('This is a test in bold underlined red')

  """
  ESCAPE = chr(033)
  ATTRS = {
      # Codes come from Perl's Term::ANSIColor module
     'clear':        0,
     'reset':        0,
     'bold':         1,
     'dark':         2,
     'faint':        2,
     'underline':    4,
     'underscore':   4,
     'blink':        5,
     'reverse':      7,
     'concealed':    8,
     'black':   30,   'on_black':    40,
{'fraction_non_alphanumeric': 0.08905506458191706, 'fraction_numerical': 0.011556764106050306, 'mean_word_length': 2.611042944785276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '4480547', 'n_tokens_mistral': 919, 'n_tokens_neox': 882, 'n_words': 354}