code: def test_partial_function(self):
      expected_test_arg = 123
  
      def fn_has_kwargs(test_arg, **x):
          if test_arg != expected_test_arg:
              return ValueError("partial fn does not work correctly")
          return x
  
      wrapped_fn = functools.partial(fn_has_kwargs, test_arg=123)
      self.assertTrue(function_utils.has_kwargs(wrapped_fn))
      some_kwargs = dict(x=1, y=2, z=3)
      self.assertEqual(wrapped_fn(**some_kwargs), some_kwargs)
  
      def fn_has_no_kwargs(x, test_arg):
          if test_arg != expected_test_arg:
              return ValueError("partial fn does not work correctly")
          return x
  
      wrapped_fn = functools.partial(fn_has_no_kwargs, test_arg=123)
      self.assertFalse(function_utils.has_kwargs(wrapped_fn))
      some_arg = 1
      self.assertEqual(wrapped_fn(some_arg), some_arg)
  
imports: import functools
  from tensorflow.python.platform import test
  from tensorflow.python.util import function_utils
label_desc: Use image node_id 4 for calling the HasKwargsTest obj's underlying member method code with example usage: obj.test_partial_function() and returns: x, x, ValueError, ValueError