old_contents: import os
  import sys
  import re
  
  import norns
  
  config = norns.config("genomepy", default="cfg/default.yaml")
  
  class Plugin(object):
      active = False
  
      def name(self):
          n = type(self).__name__.replace("Plugin", "")
          return convert(n)
  
      def activate(self):
          self.active = True
  
      def deactivate(self):
          self.active = False
  
      def after_genome_download(self, genome):
          raise NotImplementedError("plugin should implement this method")
  
      def get_properties(self, genome):
          raise NotImplementedError("plugin should implement this method")
  
  
  def find_plugins():
      plugin_dir = os.path.dirname(os.path.realpath(__file__))
      plugin_dir = os.path.join(plugin_dir, "plugins")
      plugin_files = [x[:-3] for x in os.listdir(plugin_dir) if x.endswith(".py")]
      sys.path.insert(0, plugin_dir)
      for plugin in plugin_files:
          bla = __import__(plugin)
  
  def convert(name):
      """Convert CamelCase to underscore
  
      Parameters
      ----------
      name : str
          Camelcase string
  
      Returns
      -------
      name : str
          Converted name
      """ 
      s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
      return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
  
  def init_plugins():
      find_plugins()
      d = {}
      print("I", config.config_file)
      print(config.get("plugin" , []))
      for c in Plugin.__subclasses__():
          ins = c()
      
          if ins.name() in config.get("plugin", []):
              ins.activate()
          
          d[ins.name()] = ins
      
      return d
  
  def activate(name):
      if name in plugins:
          plugins[name].activate()
      else:
          raise Exception("plugin {} not found".format(name))
  
  def deactivate(name):
      if name in plugins:
          plugins[name].deactivate()
      else:
          raise Exception("plugin {} not found".format(name))
  
  def get_active_plugins():
      for p,v in plugins.items():
          print(p, v.active)
      return [inst for name, inst in plugins.items() if inst.active]
  
  plugins = init_plugins()
  
  
  
  
new_contents: import os
  import sys
  import re
  
  import norns
  
  config = norns.config("genomepy", default="cfg/default.yaml")
  
  class Plugin(object):
      active = False
  
      def name(self):
          n = type(self).__name__.replace("Plugin", "")
          return convert(n)
  
      def activate(self):
          self.active = True
  
      def deactivate(self):
          self.active = False
  
      def after_genome_download(self, genome):
          raise NotImplementedError("plugin should implement this method")
  
      def get_properties(self, genome):
          raise NotImplementedError("plugin should implement this method")
  
  
  def find_plugins():
      plugin_dir = os.path.dirname(os.path.realpath(__file__))
      plugin_dir = os.path.join(plugin_dir, "plugins")
      plugin_files = [x[:-3] for x in os.listdir(plugin_dir) if x.endswith(".py")]
      sys.path.insert(0, plugin_dir)
      for plugin in plugin_files:
          bla = __import__(plugin)
  
  def convert(name):
      """Convert CamelCase to underscore
  
      Parameters
      ----------
      name : str
          Camelcase string
  
      Returns
      -------
      name : str
          Converted name
      """ 
      s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
      return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
  
  def init_plugins():
      find_plugins()
      d = {}
      for c in Plugin.__subclasses__():
          ins = c()
      
          if ins.name() in config.get("plugin", []):
              ins.activate()
          
          d[ins.name()] = ins
      
      return d
  
  def activate(name):
      if name in plugins:
          plugins[name].activate()
      else:
          raise Exception("plugin {} not found".format(name))
  
  def deactivate(name):
      if name in plugins:
          plugins[name].deactivate()
      else:
          raise Exception("plugin {} not found".format(name))
  
  def get_active_plugins():
      for p,v in plugins.items():
      return [inst for name, inst in plugins.items() if inst.active]
  
  plugins = init_plugins()
  
  
  
  
subject: remove prints