deeppavlov/core/common/metrics_registry.py
def fn_from_str(name: str) -> Callable[..., Any]:
    """Returns a function object with the name given in string."""
    try:
        module_name, fn_name = name.split(':')
    except ValueError:
        raise ConfigError('Expected function description in a `module.submodules:function_name` form, but got `{}`'
                          .format(name))

    return getattr(importlib.import_module(module_name), fn_name)
def fn_from_str(name: str) -> Callable[..., Any]:
    try:
        module_name, fn_name = name.split(':')
    except ValueError:
        raise ConfigError('Expected function description in a `module.submodules:function_name` form, but got `{}`'
                          .format(name))

    return getattr(importlib.import_module(module_name), fn_name)
def fn_from_str ( name : str ) -> Callable [ ... , Any ] : try : module_name , fn_name = name . split ( ':' ) except ValueError : raise ConfigError ( 'Expected function description in a `module.submodules:function_name` form, but got `{}`' . format ( name ) ) return getattr ( importlib . import_module ( module_name ) , fn_name )
Returns a function object with the name given in string.
Returns a function object with the name given in string .