code: def _rename_kwargs(
      func_name: str, kwargs: Dict[str, Any], aliases: Dict[str, str]
  ):
      """
      Private function to rename deprecated kwarg to new name, and raise DeprecationWarning.
      """
      for alias, new in aliases.items():
          if alias in kwargs:
              if new in kwargs:
                  raise ValueError(
                      f"{func_name} received both the deprecated kwarg `{alias}` "
                      f"and it's replacement `{new}`."
                  )
              warnings.warn(
                  f"`{alias}` is deprecated; use `{new}`.",
                  UserWarning,
                  stacklevel=3,
              )
              kwargs[new] = kwargs.pop(alias)
  
imports: import functools
  import warnings
  from typing import Dict, Any, Callable
label_desc: Use image node_id 2 for calling a global function with example usage: _rename_kwargs(func_name, kwargs, aliases) without return types