import importlib

#from parlai.agents.programr.utils.logging.ylogger import YLogger
import parlai.utils.logging as logging

class ClassLoader(object):

    @staticmethod
    def instantiate_class(class_string):
        processor_path = class_string.strip()
        #YLogger.debug(None, "Processor path [%s]", processor_path)
        logging.debug(f"Processor path {processor_path}")

        last_dot = processor_path.rfind(".")
        module_path = processor_path[:last_dot]
        class_name = processor_path[last_dot+1:]

        #YLogger.debug(None, "Importing module [%s]", module_path)
        logging.debug(f"Importing module {module_path}")
        imported_module = importlib.import_module(module_path)

        #YLogger.debug(None, "Instantiating class [%s]", class_name)
        logging.debug(f"Instantiating class {class_name}")
        new_class = getattr(imported_module, class_name)
        return new_class

ddb4a2736a9e211b92fae539f2c97bd9e465b49c
<mask token>

<mask token>


class ClassLoader(object):
    <mask token>

<mask token>


class ClassLoader(object):

    @staticmethod
    def instantiate_class(class_string):
        processor_path = class_string.strip()
        logging.debug(f'Processor path {processor_path}')
        last_dot = processor_path.rfind('.')
        module_path = processor_path[:last_dot]
        class_name = processor_path[last_dot + 1:]
        logging.debug(f'Importing module {module_path}')
        imported_module = importlib.import_module(module_path)
        logging.debug(f'Instantiating class {class_name}')
        new_class = getattr(imported_module, class_name)
        return new_class

import importlib
import parlai.utils.logging as logging


class ClassLoader(object):

    @staticmethod
    def instantiate_class(class_string):
        processor_path = class_string.strip()
        logging.debug(f'Processor path {processor_path}')
        last_dot = processor_path.rfind('.')
        module_path = processor_path[:last_dot]
        class_name = processor_path[last_dot + 1:]
        logging.debug(f'Importing module {module_path}')
        imported_module = importlib.import_module(module_path)
        logging.debug(f'Instantiating class {class_name}')
        new_class = getattr(imported_module, class_name)
        return new_class

import importlib

#from parlai.agents.programr.utils.logging.ylogger import YLogger
import parlai.utils.logging as logging

class ClassLoader(object):

    @staticmethod
    def instantiate_class(class_string):
        processor_path = class_string.strip()
        #YLogger.debug(None, "Processor path [%s]", processor_path)
        logging.debug(f"Processor path {processor_path}")

        last_dot = processor_path.rfind(".")
        module_path = processor_path[:last_dot]
        class_name = processor_path[last_dot+1:]

        #YLogger.debug(None, "Importing module [%s]", module_path)
        logging.debug(f"Importing module {module_path}")
        imported_module = importlib.import_module(module_path)

        #YLogger.debug(None, "Instantiating class [%s]", class_name)
        logging.debug(f"Instantiating class {class_name}")
        new_class = getattr(imported_module, class_name)
        return new_class
