code: def register_model(name):
      def register_model_cls(cls):
          if name in MODEL_DICT:
              raise ValueError(
                  "Cannot register duplicate trainer ({})".format(name)
              )
          if not issubclass(cls, BaseAutoModel):
              raise ValueError(
                  "Trainer ({}: {}) must extend BaseModel".format(
                      name, cls.__name__
                  )
              )
          MODEL_DICT[name] = cls
          return cls
  
      return register_model_cls
  
imports: import typing
  from .base import BaseAutoModel
label_desc: Use image node_id 1 for calling a global function with example usage: register_model(name) and returns: register_model_cls, cls