code: def get_name(cls):
      """Returns the registered name for TypeSpec `cls`."""
      if not (
          isinstance(cls, type) and issubclass(cls, internal.TypeSpec)
      ):
          raise TypeError(
              "Expected `cls` to be a TypeSpec; got %r" % (cls,)
          )
      if cls not in _TYPE_SPEC_TO_NAME:
          raise ValueError(
              "TypeSpec %s.%s has not been registered."
              % (cls.__module__, cls.__name__)
          )
      return _TYPE_SPEC_TO_NAME[cls]
  
imports: import re
  from tensorflow.python.types import internal
label_desc: Use image node_id 2 for calling a global function with example usage: get_name(cls) and returns: _TYPE_SPEC_TO_NAME