code: def test_deprecated_argument():
      # Tests the decorator with function, method, staticmethod and classmethod.
      class CustomActor:
          @classmethod
          @deprecated_params("height", "scale", "0.3")
          def test1(cls, scale):
              return scale
  
          @staticmethod
          @deprecated_params("height", "scale", "0.3")
          def test2(scale):
              return scale
  
          @deprecated_params("height", "scale", "0.3")
          def test3(self, scale):
              return scale
  
          @deprecated_params("height", "scale", "0.3", "0.5")
          def test4(self, scale):
              return scale
  
          @deprecated_params("height", "scale", "0.3", "10.0.0")
          def test5(self, scale):
              return scale
  
      @deprecated_params("height", "scale", "0.3")
      def custom_actor(scale):
          return scale
  
      @deprecated_params("height", "scale", "0.3", "0.5")
      def custom_actor_2(scale):
          return scale
  
      for method in [
          CustomActor().test1,
          CustomActor().test2,
          CustomActor().test3,
          CustomActor().test4,
          custom_actor,
          custom_actor_2,
      ]:
          # As positional argument only
          npt.assert_equal(method(1), 1)
          # As new keyword argument
          npt.assert_equal(method(scale=1), 1)
          # As old keyword argument
          if method.__name__ not in ["test4", "custom_actor_2"]:
              res = npt.assert_warns(
                  ArgsDeprecationWarning, method, height=1
              )
              npt.assert_equal(res, 1)
          else:
              npt.assert_raises(
                  ExpiredDeprecationError, method, height=1
              )
  
          # Using both. Both keyword
          npt.assert_raises(TypeError, method, height=2, scale=1)
          # One positional, one keyword
          npt.assert_raises(TypeError, method, 1, scale=2)
  
      with warnings.catch_warnings(record=True) as w_record:
          res = CustomActor().test5(4)
  
          # Select only UserWarning
          selected_w = [
              w for w in w_record if issubclass(w.category, UserWarning)
          ]
          npt.assert_equal(len(selected_w), 0)
          npt.assert_equal(res, 4)
  
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 5 for calling a global function with example usage: test_deprecated_argument() and returns: scale, scale, scale, scale, scale, scale, scale