code: 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(":")
          return getattr(importlib.import_module(module_name), fn_name)
      except ValueError:
          raise ConfigError(
              "Expected function description in a `module.submodules:function_name` form, but got `{}`".format(
                  name
              )
          )
      except AttributeError:
          # noinspection PyUnboundLocalVariable
          raise ConfigError(
              f"Incorrect metric: '{module_name}' has no attribute '{fn_name}'."
          )
  
file_path: DeepPavlov/deeppavlov/core/common/metrics_registry.py
imports: import importlib
  import json
  from logging import getLogger
  from pathlib import Path
  from typing import Callable, Any
  from deeppavlov.core.common.errors import ConfigError
label_desc: Use image node_id 1 for calling a global function with example usage: fn_from_str(name) and returns: getattr