class_docstr: Tests which can only run in Python 3.
class_docstr_tok: ["Tests","which","can","only","run","in","Python","3","."]
code: def test_nonlocal_in_nested_function(self):
      a = 3
      b = 13
  
      def test_fn():
          a = 3
          b = 13
  
          def local_fn():
              nonlocal a, b
              if a:
                  b = []
              return a, b
  
          return local_fn()
  
      node = self._parse_and_analyze(test_fn)
      local_body = node.body[2].body
  
      self.assertHasDefs(local_body[1].test, 1)
      self.assertHasDefs(local_body[1].body[0].targets[0], 1)
      self.assertHasDefs(local_body[2].value.elts[0], 1)
      self.assertHasDefs(local_body[2].value.elts[1], 2)
  
      self.assertSameDef(
          local_body[1].test, local_body[2].value.elts[0]
      )
  
      # Note: the function name is visible inside the function body. But it's
      # a closure variable, not a local.
      #
      # Example:
      #
      #   >>> def f():
      #   ...  print(f)
      #   >>> g = f
      #   >>> f = 'something else'
      #   >>> g()
      #   something else
      #
      self.assertHasDefinedIn(local_body[1], ("a", "b"))
  
imports: from tensorflow.python.autograph.pyct.static_analysis import reaching_definitions_test
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the ReachingDefinitionsAnalyzerTest obj's underlying member method code with example usage: obj.test_nonlocal_in_nested_function() and returns: local_fn, a,  b