code: def deprecated(
      replace_with: Optional[str] = None,
      version: Optional[str] = None,
      extra_reason: Optional[str] = None,
  ) -> Any:
      def _deprecated(func: Callable[..., Any]) -> Any:
          @wraps(func)
          def wrapper(*args: Any, **kwargs: Any) -> Any:
              name = ""
              beginning = (
                  f"Since kornia {version} the "
                  if version is not None
                  else ""
              )
  
              if isclass(func):
                  name = func.__class__.__name__
              if isfunction(func):
                  name = func.__name__
              warnings.simplefilter("always", DeprecationWarning)
              if replace_with is not None:
                  warnings.warn(
                      f"{beginning}`{name}` is deprecated in favor of `{replace_with}`.{extra_reason}",
                      category=DeprecationWarning,
                      stacklevel=2,
                  )
              else:
                  warnings.warn(
                      f"{beginning}`{name}` is deprecated and will be removed in the future versions.{extra_reason}",
                      category=DeprecationWarning,
                      stacklevel=2,
                  )
              warnings.simplefilter("default", DeprecationWarning)
              return func(*args, **kwargs)
  
          return wrapper
  
      return _deprecated
  
imports: import platform
  import sys
  import warnings
  from functools import wraps
  from inspect import isclass, isfunction
  from typing import TYPE_CHECKING, Any, Callable, List, Optional, Tuple, Union, overload
  import torch
  from torch.linalg import inv_ex
  from kornia.core import Tensor
  from kornia.utils._compat import torch_version_ge
label_desc: Use image node_id 7 for calling a global function with example usage: deprecated(replace_with, version, extra_reason) and returns: _deprecated, wrapper, func