<commit_before>#!@/usr/bin/python
import pickle 
import random
import os
HOME = os.path.expanduser("~")
MTEB = os.path.join(HOME, ".phenny/modules/mteb")

def read_config(name):
  with open(os.path.join(MTEB, name), "rb") as f:
    return pickle.load(f)

def write_config(obj, name):
  with open(os.path.join(MTEB, name), "wb") as f:
    pickle.dump(obj, f)

def mteb(phenny, input):
  if input.startswith(".mteb credits"):
    phenny.say('mteb was created by <NAME> after ')
    phenny.say('he witnessed mike thompson eat a baby, which, ')
    phenny.say('while possibly traumatic for Chris, saved the ')
    phenny.say('baby from a lifetime of misery, failure, and boredom.')
    phenny.say(' ')
    phenny.say('Chris\'s current projects on the internet can be found here:')
    phenny.say('http://mediagoblin.org')
    phenny.say('http://dustycloud.org')
    phenny.say('If you have money, you should give some to media goblin.')
    phenny.say(' ')
    phenny.say(' ')
  phenny.say('  <NAME>')
  phenny.say('    ||||||')
  phenny.say('   "" \  /')
  phenny.say('   "" o  o     S')<commit_msg>added docstrings for helper functions<commit_after>#!@/usr/bin/python
"""
simple mods for the phenny irc bot to display ascii art, get fortunes, etc
"""

__author__ = "<EMAIL>"

import pickle 
import random
import os
HOME = os.path.expanduser("~")
MTEB = os.path.join(HOME, ".phenny/modules/mteb")

def read_config(name):
  """
  Read pickled config data.

  Args: 
    name - a string generally corresponding to the phenny command

  Returns:
    the unpickled object.  Usually a list
  """
  with open(os.path.join(MTEB, name), "rb") as f:
    return pickle.load(f)

def write_config(obj, name):
  """
  Writes an object to disc in the MTEB defined path with the given name.

  Args: 
    name - a string generally corresponding to the phenny command
  """
  with open(os.path.join(MTEB, name), "wb") as f:
    pickle.dump(obj, f)

def mteb(phenny, input):
  if input.startswith(".mteb credits"):
    phenny.say('mteb was created by <NAME> after ')
    phenny.say('he witnessed mike thompson eat a baby, which, ')
    phenny.say('while possibly traumatic for Chris, saved the ')
    phenny.say('baby from a lifetime of misery, failure, and boredom.')
    phenny.say(' ')
    phenny.say('Chris\'s current projects on the internet can be found here:')
    phenny.say('http://mediagoblin.org')
    phenny.say('http://dustycloud.org')
    phenny.say('If you have money, you should give some to media goblin.')
    phenny.say(' ')
    phenny.say(' ')
  phenny.say('  <NAME>')
  phenny.say('    ||||||')
  phenny.say('   "" \  /')
  phenny.say('   "" o  o     S')
{'fraction_non_alphanumeric': 0.15178907721280602, 'fraction_numerical': 0.0, 'mean_word_length': 3.3973509933774833, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '5666585', 'n_tokens_mistral': 961, 'n_tokens_neox': 941, 'n_words': 270}