code: def test_foo():
      p = foo
      try:
          res1 = p(1, 2, 3, 4, b=5)
          res2 = Exception()
      except:
          res1, res2 = sys.exc_info()[:2]
      try:
          re_1 = validate(p, 1, 2, 3, 4, b=5)
          re_2 = Exception()
      except:
          re_1, re_2 = sys.exc_info()[:2]
      assert re_1 is None
  
      try:
          res1 = p()
          res2 = Exception()
      except:
          res1, res2 = sys.exc_info()[:2]
      try:
          re_1 = validate(p)
          re_2 = Exception()
      except:
          re_1, re_2 = sys.exc_info()[:2]
      assert res1 == re_1
      # XXX: "foo() missing 3 required positional arguments"
  
      try:
          res1 = p(1, 2, 3, 4, r=5)
          res2 = Exception()
      except:
          res1, res2 = sys.exc_info()[:2]
      try:
          re_1 = validate(p, 1, 2, 3, 4, r=5)
          re_2 = Exception()
      except:
          re_1, re_2 = sys.exc_info()[:2]
      assert res1 == re_1
  
file_path: klepto/klepto/tests/test_validate.py
imports: import sys
  from functools import partial
  from klepto import validate
label_desc: Use image node_id 2 for calling a global function with example usage: test_foo() without return types