code: def deprecated_alias(
      deprecated_name, name, func_or_class, warn_once=True
  ):
      """Deprecates a symbol in favor of a renamed function or class.
  
      Args:
        deprecated_name: Fully qualified name of deprecated symbol.
        name: New symbol name.
        func_or_class: Non-deprecated function or class, to be used as alias.
        warn_once: Whether only one warning should be emitted for multiple calls to
          deprecated symbol.
  
      Returns:
        Decorated function or method.
      """
      if inspect.isclass(func_or_class):
          new_doc = _make_alias_docstring(name, func_or_class)
  
          class _NewDeprecatedClass(
              func_or_class
          ):  # pylint: disable=empty-docstring
              __doc__ = new_doc
              __name__ = func_or_class.__name__
              __module__ = _call_location(levels=3)
  
              # Marker so that instrospection can determine that this is a deprecated
              # class wrapper.
              _TFX_DEPRECATED_CLASS = True
  
              @functools.wraps(func_or_class.__init__)
              def __init__(self, *args, **kwargs):
                  _NewDeprecatedClass.__init__.__doc__ = (
                      func_or_class.__init__.__doc__
                  )
                  if _should_warn(
                      _NewDeprecatedClass.__init__, warn_once=warn_once
                  ):
                      call_loc = _call_location()
                      warn_deprecated(
                          f"From {call_loc}: The name {deprecated_name} is deprecated. "
                          f"Please use {name} instead."
                      )
                  super().__init__(*args, **kwargs)
  
          return _NewDeprecatedClass
      else:
          _validate_callable(func_or_class)
  
          @functools.wraps(func_or_class)
          def new_func(
              *args, **kwargs
          ):  # pylint: disable=empty-docstring
              if _should_warn(new_func, warn_once=warn_once):
                  call_loc = _call_location()
                  warn_deprecated(
                      f"From {call_loc}: The name {deprecated_name} is deprecated. "
                      f"Please use {name} instead."
                  )
              return func_or_class(*args, **kwargs)
  
          return new_func
  
file_path: tfx/tfx/utils/deprecation_utils.py
imports: import functools
  import inspect
  import warnings
label_desc: Use image node_id 6 for calling a global function with example usage: deprecated_alias(deprecated_name, name, func_or_class, warn_once) and returns: _NewDeprecatedClass, new_func, func_or_class