class_docstr: Tracks experiment specifications.
  
  Implicitly registers the Trainable if needed. The args here take
  the same meaning as the arguments defined `tune.py:run`.
  
  .. code-block:: python
  
      experiment_spec = Experiment(
          "my_experiment_name",
          my_func,
          stop={"mean_accuracy": 100},
          config={
              "alpha": tune.grid_search([0.2, 0.4, 0.6]),
              "beta": tune.grid_search([1, 2]),
          },
          resources_per_trial={
              "cpu": 1,
              "gpu": 0
          },
          num_samples=10,
          local_dir="~/ray_results",
          checkpoint_freq=10,
          max_failures=2)
class_docstr_tok: ["Tracks","experiment","specifications",".","Implicitly","registers","the","Trainable","if","needed",".","The","args","here","take","the","same","meaning","as","the","arguments","defined","`","tune.py",":","run","`",".","..","code-block",":",":","python","experiment_spec","=","Experiment","(","``","my_experiment_name","''",",","my_func",",","stop=","{","``","mean_accuracy","''",":","100","}",",","config=","{","``","alpha","''",":","tune.grid_search","(","[","0.2",",","0.4",",","0.6","]",")",",","``","beta","''",":","tune.grid_search","(","[","1",",","2","]",")",",","}",",","resources_per_trial=","{","``","cpu","''",":","1",",","``","gpu","''",":","0","}",",","num_samples=10",",","local_dir=","''","~\/ray_results","''",",","checkpoint_freq=10",",","max_failures=2",")"]
docstr: Get Trainable name.
  
  Args:
      run_object: 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.
  
  Raises:
      TuneError: if ``run_object`` passed in is invalid.
docstr_tok: ["Get","Trainable","name",".","Args",":","run_object",":","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",".","Raises",":","TuneError",":","if","``","run_object","``","passed","in","is","invalid","."]
code: def get_trainable_name(cls, run_object: Union[str, Callable, Type]):
      """Get Trainable name.
  
      Args:
          run_object: 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.
  
      Raises:
          TuneError: if ``run_object`` passed in is invalid.
      """
      from ray.tune.search.sample import Domain
  
      if isinstance(run_object, str) or isinstance(run_object, Domain):
          return run_object
      elif isinstance(run_object, type) or callable(run_object):
          name = "DEFAULT"
          if hasattr(run_object, "_name"):
              name = run_object._name
          elif hasattr(run_object, "__name__"):
              fn_name = run_object.__name__
              if fn_name == "<lambda>":
                  name = "lambda"
              elif fn_name.startswith("<"):
                  name = "DEFAULT"
              else:
                  name = fn_name
          elif (
              isinstance(run_object, partial)
              and hasattr(run_object, "func")
              and hasattr(run_object.func, "__name__")
          ):
              name = run_object.func.__name__
          else:
              logger.warning(
                  "No name detected on trainable. Using {}.".format(
                      name
                  )
              )
          return name
      else:
          raise TuneError("Improper 'run' - not string nor trainable.")
  
imports: import copy
  import datetime
  from functools import partial
  import logging
  from pathlib import Path
  from pickle import PicklingError
  import pprint
  import traceback
  from typing import Any, Dict, Optional, Sequence, Union, Callable, Type, List, Mapping, TYPE_CHECKING
  import ray
  from ray.exceptions import RpcError
  from ray.train import CheckpointConfig, SyncConfig
  from ray.train._internal.storage import StorageContext
  from ray.tune.error import TuneError
  from ray.tune.registry import register_trainable, is_function_trainable
  from ray.tune.stopper import CombinedStopper, FunctionStopper, Stopper, TimeoutStopper
  from ray.util.annotations import DeveloperAPI, Deprecated
label_desc: Use image node_id 3 for calling the Experiment obj's underlying member method code with example usage: obj.get_trainable_name(cls, run_object) and returns: run_object, name