<commit_before>import glob, os, sys
import time

class PorkchopPlugin(object):
  def __init__(self):
    self.refresh = 60
    self.last_refresh = None

  def should_refresh(self):
    now = time.time()
    if self.last_refresh:
      if not time.time() - self.last_refresh >= self.refresh:
        return False
    else:
      return True

class PorkchopPluginHandler(object):
  plugins = []

  def __init__(self, directory = None):
    if directory:
      PorkchopPluginHandler.plugins = self.load_plugins(directory)

  def load_plugins(self, directory):
    sys.path.insert(0, directory)
    modules = []

    for infile in glob.glob(os.path.join(directory, '*.py')):
      if not infile == '__init__.py':
        modules.append(__import__(os.path.splitext(os.path.split(infile)[1])[0]))

    return modules<commit_msg>really dont load __init__.py as a plugin<commit_after>import glob, os, sys
import time

class PorkchopPlugin(object):
  def __init__(self):
    self.refresh = 60
    self.last_refresh = None

  def should_refresh(self):
    now = time.time()
    if self.last_refresh:
      if not time.time() - self.last_refresh >= self.refresh:
        return False
    else:
      return True

class PorkchopPluginHandler(object):
  plugins = []

  def __init__(self, directory = None):
    if directory:
      PorkchopPluginHandler.plugins = self.load_plugins(directory)

  def load_plugins(self, directory):
    sys.path.insert(0, directory)
    modules = []

    for infile in glob.glob(os.path.join(directory, '*.py')):
      if not os.path.basename(infile) == '__init__.py':
        print infile
        modules.append(__import__(os.path.splitext(os.path.split(infile)[1])[0]))

    return modules
{'fraction_non_alphanumeric': 0.11871345029239766, 'fraction_numerical': 0.005847953216374269, 'mean_word_length': 3.298994974874372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2172815', 'n_tokens_mistral': 558, 'n_tokens_neox': 542, 'n_words': 125}