def test_entity_to_graph_callable(self):
    b = 2

    def f(a):
        return (a + b)
    program_ctx = self._simple_program_ctx()
    (nodes, name, ns) = conversion.entity_to_graph(f, program_ctx, None, None)
    (fn_node, _) = nodes
    self.assertIsInstance(fn_node, gast.FunctionDef)
    self.assertEqual('tf__f', name)
    self.assertIs(ns['b'], b)
def test_entity_to_graph_callable(self):
    b = 2

    def f(a):
        return (a + b)
    program_ctx = self._simple_program_ctx()
    (nodes, name, ns) = conversion.entity_to_graph(f, program_ctx, None, None)
    (fn_node, _) = nodes
    self.assertIsInstance(fn_node, gast.FunctionDef)
    self.assertEqual('tf__f', name)
    self.assertIs(ns['b'], b)