def test_do_not_convert_callable_object(self): class TestClass(object): def __call__(self): return 1 tc = TestClass() self.assertEqual(1, api.do_not_convert(tc)())
class TestClass(object): def test_method(self, x, y): z = x + y return z test_method_whitelisted = api.do_not_convert(test_method)
class TestClass(object): @api.do_not_convert(run_as=api.RunMode.GRAPH) def test_method(self, x, y): z = x + y return z test_method_do_not_convert = api.do_not_convert( run_as=api.RunMode.GRAPH)(test_method)