code: def _warn_deprecated_params(
      replacement_params, end_version, lib_name, kwargs
  ):
      """Raise warnings about deprecated parameters, \
      for the decorator replace_parameters().
  
      Parameters
      ----------
      replacement_params : Dict[str, str]
          Dictionary of old_parameters as keys with replacement parameters
          as their corresponding values.
  
      end_version : str
          The version where use of the deprecated parameters will raise an error.
          For informational purpose in the warning text.
  
      lib_name : str
          Name of the library. For informational purpose in the warning text.
  
      kwargs : Dict[str, any]
          Dictionary of all the keyword args passed on the decorated function.
  
      """
      used_deprecated_params = set(kwargs).intersection(
          replacement_params
      )
      for deprecated_param_ in used_deprecated_params:
          replacement_param = replacement_params[deprecated_param_]
          param_deprecation_msg = (
              f'The parameter "{deprecated_param_}" '
              f"will be removed in {end_version} release of {lib_name}. "
              f'Please use the parameter "{replacement_param}" instead.'
          )
          warnings.warn(
              category=DeprecationWarning,
              message=param_deprecation_msg,
              stacklevel=3,
          )
  
file_path: nilearn/nilearn/_utils/helpers.py
imports: import functools
  import operator
  import os
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: _warn_deprecated_params(replacement_params, end_version, lib_name, kwargs) without return types