code: def register_train_step(name: str):
      """
      Registers Self-Supervision Train step.
  
      This decorator allows VISSL to add custom train steps, even if the
      train step itself is not part of VISSL. To use it, apply this decorator
      to a train step function, like this:
  
      .. code-block:: python
  
          @register_train_step('my_step_name')
          def my_step_name():
              ...
  
      To get a train step from a configuration file, see :func:`get_train_step`.
      """
  
      def register_train_step_cls(cls):
          if name in TRAIN_STEP_REGISTRY:
              raise ValueError(
                  "Cannot register duplicate train step ({})".format(
                      name
                  )
              )
  
          if cls.__name__ in TRAIN_STEP_NAMES:
              raise ValueError(
                  "Cannot register task with duplicate train step name ({})".format(
                      cls.__name__
                  )
              )
          TRAIN_STEP_REGISTRY[name] = cls
          TRAIN_STEP_NAMES.add(cls.__name__)
          return cls
  
      return register_train_step_cls
  
imports: from pathlib import Path
  from classy_vision.generic.registry_utils import import_all_modules
label_desc: Use image node_id 1 for calling a global function with example usage: register_train_step(name) and returns: register_train_step_cls, cls