code: def test_deprecated_argument_in_kwargs():
      # To rename an argument that is consumed by "kwargs" the "arg_in_kwargs"
      # parameter is used.
      @deprecated_params("height", "scale", "0.3", arg_in_kwargs=True)
      def test(**kwargs):
          return kwargs["scale"]
  
      @deprecated_params(
          "height", "scale", "0.3", "0.5", arg_in_kwargs=True
      )
      def test2(**kwargs):
          return kwargs["scale"]
  
      # As positional argument only
      npt.assert_raises(TypeError, test, 1)
  
      # As new keyword argument
      npt.assert_equal(test(scale=1), 1)
  
      # Using the deprecated name
      res = npt.assert_warns(ArgsDeprecationWarning, test, height=1)
      npt.assert_equal(res, 1)
  
      npt.assert_raises(ExpiredDeprecationError, test2, height=1)
  
      # Using both. Both keyword
      npt.assert_raises(TypeError, test, height=2, scale=1)
      # One positional, one keyword
      npt.assert_raises(TypeError, test, 1, scale=2)
  
file_path: dipy/dipy/utils/tests/test_deprecator.py
imports: import sys
  import warnings
  import numpy.testing
  import pytest
  import dipy
  from dipy.testing import clear_and_catch_warnings, assert_true
  from dipy.utils.deprecator import cmp_pkg_version, _add_dep_doc, _ensure_cr, deprecate_with_version, deprecated_params, ArgsDeprecationWarning, ExpiredDeprecationError
label_desc: Use image node_id 6 for calling a global function with example usage: test_deprecated_argument_in_kwargs() and returns: kwargs, kwargs