code: def deprecated_keyword_arg(
      identifier: str,
      end_version: str,
      *,
      reason: str = "",
      replaced_by: str = "",
  ) -> Callable:
      """
      Deprecate a keyword argument and raise a `DeprecationWarning`.
  
      The `@deprecated_keyword_arg` decorator is used to deprecate keyword arguments. The deprecated keyword argument must
      default to `Deprecated`. Several use cases are supported. For example one can use it to to rename a keyword
      identifier. The following code examples provide different use cases of how to use the decorator.
  
      .. code-block:: python
  
        @deprecated_keyword_arg("print", "1.1.0", replaced_by="verbose")
        def simple_addition(a, b, print=Deprecated, verbose=False):
            if verbose:
                print(a + b)
            return a + b
  
        @deprecated_keyword_arg("verbose", "1.1.0")
        def simple_addition(a, b, verbose=Deprecated):
            return a + b
  
      :param identifier: Keyword identifier.
      :param end_version: Release version of removal.
      :param reason: Additional deprecation reason.
      :param replaced_by: Function that replaces deprecated function.
      """
  
      def decorator(function):
          reason_msg = "\n" + reason if reason else reason
          replaced_msg = (
              f" It will be replaced by '{replaced_by}'."
              if replaced_by
              else replaced_by
          )
          deprecated_msg = (
              f"Keyword argument '{identifier}' in '{function.__name__}' is deprecated and will be removed in"
              f" future release {end_version}."
          )
  
          @wraps(function)
          def wrapper(*args, **kwargs):
              params = signature(function).bind(*args, **kwargs)
              params.apply_defaults()
  
              if (
                  params.signature.parameters[identifier].default
                  is not Deprecated
              ):
                  raise ValueError(
                      "Deprecated keyword argument must default to the Decorator singleton."
                  )
              if (
                  replaced_by != ""
                  and replaced_by not in params.arguments
              ):
                  raise ValueError(
                      "Deprecated keyword replacement not found in function signature."
                  )
  
              if params.arguments[identifier] is not Deprecated:
                  warnings.simplefilter(
                      "always", category=DeprecationWarning
                  )
                  warnings.warn(
                      deprecated_msg + replaced_msg + reason_msg,
                      category=DeprecationWarning,
                      stacklevel=2,
                  )
                  warnings.simplefilter(
                      "default", category=DeprecationWarning
                  )
              return function(*args, **kwargs)
  
          return wrapper
  
      return decorator
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import math
  import os
  import shutil
  import sys
  import tarfile
  import warnings
  import zipfile
  from functools import wraps
  from inspect import signature
  from typing import TYPE_CHECKING, Callable, List, Dict, Optional, Tuple, Union
  import numpy
  import six
  from scipy.special import gammainc
  from tqdm.auto import tqdm
  from art import config
label_desc: Use image node_id 2 for calling a global function with example usage: deprecated_keyword_arg(identifier, end_version) and returns: decorator, wrapper, function