deeppavlov/core/common/registry.py
def cls_from_str(name: str) -> type:
    """Returns a class object with the name given as a string."""
    try:
        module_name, cls_name = name.split(':')
    except ValueError:
        raise ConfigError('Expected class description in a `module.submodules:ClassName` form, but got `{}`'
                          .format(name))

    return getattr(importlib.import_module(module_name), cls_name)
def cls_from_str(name: str) -> type:
    try:
        module_name, cls_name = name.split(':')
    except ValueError:
        raise ConfigError('Expected class description in a `module.submodules:ClassName` form, but got `{}`'
                          .format(name))

    return getattr(importlib.import_module(module_name), cls_name)
def cls_from_str ( name : str ) -> type : try : module_name , cls_name = name . split ( ':' ) except ValueError : raise ConfigError ( 'Expected class description in a `module.submodules:ClassName` form, but got `{}`' . format ( name ) ) return getattr ( importlib . import_module ( module_name ) , cls_name )
Returns a class object with the name given as a string.
Returns a class object with the name given as a string .