code: def register(name: str = None) -> type:
      """
      Register classes that could be initialized from JSON configuration file.
      If name is not passed, the class name is converted to snake-case.
      """
  
      def decorate(model_cls: type, reg_name: str = None) -> type:
          model_name = reg_name or short_name(model_cls)
          global _REGISTRY
          cls_name = model_cls.__module__ + ":" + model_cls.__name__
          if (
              model_name in _REGISTRY
              and _REGISTRY[model_name] != cls_name
          ):
              logger.warning(
                  'Registry name "{}" has been already registered and will be overwritten.'.format(
                      model_name
                  )
              )
          _REGISTRY[model_name] = cls_name
          return model_cls
  
      return lambda model_cls_name: decorate(model_cls_name, name)
  
file_path: DeepPavlov/deeppavlov/core/common/registry.py
imports: import importlib
  import json
  from logging import getLogger
  from pathlib import Path
  from deeppavlov.core.common.errors import ConfigError
label_desc: Use image node_id 2 for calling a global function with example usage: register(name) and returns: function, model_cls