code: def test_single_enclosing_class(self):
      class Foo:
          def __init__(self):
              self.val = 1
  
          def bar(self):
              x = 2
  
              def fn():
                  return self.val + x
  
              return fn
  
      foo = Foo()
      fn = foo.bar()
      self_obj = free_vars_detect._get_self_obj_from_closure(fn)
      self.assertIs(self_obj, foo)
  
imports: import functools
  import unittest
  from absl.testing import parameterized
  import numpy
  from tensorflow.core.function.capture import free_vars_detect
  from tensorflow.python.util import tf_decorator
label_desc: Use image node_id 1 for calling the GetSelfObjFromClosureTest obj's underlying member method code with example usage: obj.test_single_enclosing_class() and returns: fn, unknown