code: def _register_if_needed(cls, run_object):
          
  
          if isinstance(run_object, six.string_types):
              return run_object
          elif isinstance(run_object, types.FunctionType):
              if run_object.__name__ == "<lambda>":
                  logger.warning(
                      "Not auto-registering lambdas - resolving as variant.")
                  return run_object
              else:
                  name = run_object.__name__
                  register_trainable(name, run_object)
                  return name
          elif isinstance(run_object, type):
              name = run_object.__name__
              register_trainable(name, run_object)
              return name
          else:
              raise TuneError("Improper 'run' - not string nor trainable.")
docs: Registers Trainable or Function at runtime.
  
          Assumes already registered if run_object is a string. Does not
          register lambdas because they could be part of variant generation.
          Also, does not inspect interface of given run_object.
  
          Arguments:
              run_object (str|function|class): Trainable to run. If string,
                  assumes it is an ID and does not modify it. Otherwise,
                  returns a string corresponding to the run_object name.
  
          Returns:
              A string representing the trainable identifier.