code: def remove_parameters(removed_params, reason, end_version="future"):
      """Use this decorator to deprecate \
      but not renamed parameters in the decorated functions and methods.
  
      Parameters
      ----------
      removed_params : list[string]
          List of old parameters to be removed.
          Example: [old_param1, old_param2, ...]
  
      reason : str
          Detailed reason of deprecated parameter and alternative solutions.
  
      end_version : str {'future' | 'next' | <version>}, default='future'
          Version when using the deprecated parameters will raise an error.
          For informational purpose in the warning text.
  
      """
  
      def _remove_params(func):
          @functools.wraps(func)
          def wrapper(*args, **kwargs):
              found = set(removed_params).intersection(kwargs)
              if found:
                  message = (
                      f'Parameter(s) {", ".join(found)} '
                      f"will be removed in version {end_version}; "
                      f"{reason}"
                  )
                  warnings.warn(
                      category=DeprecationWarning,
                      message=message,
                      stacklevel=3,
                  )
              return func(*args, **kwargs)
  
          return wrapper
  
      return _remove_params
  
file_path: nilearn/nilearn/_utils/helpers.py
imports: import functools
  import operator
  import os
  import warnings
label_desc: Use image node_id 4 for calling a global function with example usage: remove_parameters(removed_params, reason, end_version) and returns: _remove_params, wrapper, func