<commit_before>import sys, os
import json
import yaml
from mcb.outputs import OutputPipe

class Config(object):

  MODE_MIRROR = 'mirror'
  MODE_FULL = 'full'

  def __init__(self):
    self.services = []
    self.outputs = []
    self.mode = self.MODE_MIRROR

    self.filepath = None

  def buildPlugin(self, conf):
    name = conf['className']

    moduleName = name[:name.rfind('.')]
    className = name[name.rfind('.')+1:]

    mod = __import__(moduleName, fromlist=[className])
    clas = getattr(mod, className)

    instance = clas()
    instance.setConfig(conf)

    return instance

  def addService(self, conf):
    if isinstance(conf, mcb.Plugin):
      conf = conf.getConfig()

    self.services.append(conf)

  def updateService(self, index, conf):
    if isinstance(conf, mcb.Plugin):<commit_msg>Fixing buildPlugin() method<commit_after>import sys, os
import json
import yaml
from mcb.outputs import OutputPipe

class Config(object):

  MODE_MIRROR = 'mirror'
  MODE_FULL = 'full'

  def __init__(self):
    self.services = []
    self.outputs = []
    self.mode = self.MODE_MIRROR

    self.filepath = None

  def buildPlugin(self, conf):
    name = conf['className']

    moduleName = name[:name.rfind('.')]
    className = name[name.rfind('.')+1:]

    mod = __import__(moduleName, fromlist=[className])
    clas = getattr(mod, className)

    instance = clas()

    conf_copy = conf.copy()
    del conf_copy['className']
    instance.setConfig(conf_copy)

    return instance

  def addService(self, conf):
    if isinstance(conf, mcb.Plugin):
      conf = conf.getConfig()

    self.services.append(conf)

  def updateService(self, index, conf):
    if isinstance(conf, mcb.Plugin):
{'fraction_non_alphanumeric': 0.1280093951849677, 'fraction_numerical': 0.0011743981209630064, 'mean_word_length': 3.4842105263157896, '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': '1144970', 'n_tokens_mistral': 574, 'n_tokens_neox': 546, 'n_words': 127}