code: def test_class_methods(self):
      class Foo:
          @typecheck_method(a=int, b=str)
          def __init__(self, a, b):
              pass
  
          @typecheck_method(x=int, y=int)
          def a(self, x, y):
              pass
  
          @staticmethod
          @typecheck(x=int, y=int)
          def b(x, y):
              pass
  
          # error because it should be typecheck_method
          @typecheck(x=int, y=int)
          def c(self, x, y):
              pass
  
          @typecheck_method(x=int, y=int, args=str, kwargs=int)
          def d(self, x, y, *args, **kwargs):
              pass
  
      Foo(2, "2")
  
      self.assertRaises(TypeError, lambda: Foo("2", "2"))
  
      f = Foo(2, "2")
  
      f.a(2, 2)
      f.b(2, 2)
      Foo.b(2, 2)
      f.d(1, 2)
      f.d(1, 2, "3")
      f.d(1, 2, "3", z=5)
  
      self.assertRaises(TypeError, lambda: f.a("2", "2"))
      self.assertRaises(TypeError, lambda: f.b("2", "2"))
      self.assertRaises(TypeError, lambda: Foo.b("2", "2"))
      self.assertRaises(RuntimeError, lambda: f.c(2, 2))
      self.assertRaises(TypeError, lambda: f.d(2, 2, 3))
      self.assertRaises(TypeError, lambda: f.d(2, 2, z="2"))
  
file_path: hail/hail/python/test/hail/typecheck/test_typecheck.py
imports: import unittest
  from hail.typecheck.check import *
label_desc: Use image node_id 4 for calling the Tests obj's underlying member method code with example usage: obj.test_class_methods() without return types