code: def testDeprecated(self):
      # By default, we warn once across all calls.
      my_function_1 = self._mock_function(name="my_function_1")
      deprecated_func_1 = deprecation_utils.deprecated(
          "2099-01-02", "Please change to new_my_function_1"
      )(my_function_1)
      deprecated_func_1()
      deprecated_func_1()
      self._assertDeprecatedWarningRegex(
          r"From .*: my_function_1 \(from .*\) is deprecated and will be "
          r"removed after 2099-01-02. Instructions for updating:\n"
          r"Please change to new_my_function_1"
      )
      self.assertEqual(my_function_1.call_count, 2)
      self._mock_warn.reset_mock()
  
      # If `warn_once=False`, we warn once for each call.
      my_function_2 = self._mock_function()
      deprecated_func_2 = deprecation_utils.deprecated(
          "2099-01-02",
          "Please change to new_my_function_2",
          warn_once=False,
      )(my_function_2)
      deprecated_func_2()
      deprecated_func_2()
      deprecated_func_2()
      self.assertEqual(self._mock_warn.call_count, 3)
      self.assertEqual(my_function_2.call_count, 3)
  
file_path: tfx/tfx/utils/deprecation_utils_test.py
imports: from unittest import mock
  import tensorflow
  from tfx.utils import deprecation_utils
  from tfx.utils import test_case_utils
label_desc: Use image node_id 4 for calling the DependencyUtilsTest obj's underlying member method code with example usage: obj.testDeprecated() without return types