code: def test_rename_parameters():
      """Integration tests that deprecates mock parameters in a mock function
      and checks that the deprecated parameters transfer their values correctly
      to replacement parameters and all deprecation warning are raised as
      expected.
      """
      (
          mock_input,
          replacement_params,
      ) = _mock_args_for_testing_replace_parameter()
      expected_output = ("dp0", "dp1", "up0", "up1")
      expected_warnings = [
          (
              'The parameter "deprecated_param_0" will be removed in 0.6.1rc '
              "release of other_lib. "
              'Please use the parameter "replacement_param_0" instead.'
          ),
          (
              'The parameter "deprecated_param_1" will be removed in 0.6.1rc '
              "release of other_lib. "
              'Please use the parameter "replacement_param_1" instead.'
          ),
      ]
  
      @helpers.rename_parameters(
          replacement_params,
          "0.6.1rc",
          "other_lib",
      )
      def mock_function(
          replacement_param_0,
          replacement_param_1,
          unchanged_param_0,
          unchanged_param_1,
      ):
          return (
              replacement_param_0,
              replacement_param_1,
              unchanged_param_0,
              unchanged_param_1,
          )
  
      with warnings.catch_warnings(record=True) as raised_warnings:
          actual_output = mock_function(
              deprecated_param_0="dp0",
              deprecated_param_1="dp1",
              unchanged_param_0="up0",
              unchanged_param_1="up1",
          )
  
      assert actual_output == expected_output
  
      expected_warnings.sort()
      raised_warnings.sort(key=lambda mem: str(mem.message))
      for raised_warning_, expected_warning_ in zip(
          raised_warnings, expected_warnings
      ):
          assert raised_warning_.category is DeprecationWarning
          assert str(raised_warning_.message) == expected_warning_
  
file_path: nilearn/nilearn/_utils/tests/test_helpers.py
imports: import warnings
  import pytest
  from nilearn._utils import helpers
label_desc: Use image node_id 2 for calling a global function with example usage: test_rename_parameters() and returns: replacement_param_0,  replacement_param_1,  unchanged_param_0,  unchanged_param_1