code: def test_python_interop(self):
      class Foo:  # noqa: B903
          def __init__(self, x, y):
              self.x = x
              self.y = y
  
      make_global(Foo)  # see [local resolution in python]
  
      @torch.jit.script
      def use_foo(foo: Foo) -> Foo:
          return foo
  
      # create from python
      x = torch.ones(2, 3)
      y = torch.zeros(2, 3)
      f = Foo(x, y)
  
      self.assertEqual(x, f.x)
      self.assertEqual(y, f.y)
  
      # pass in and out of script
      f2 = use_foo(f)
  
      self.assertEqual(x, f2.x)
      self.assertEqual(y, f2.y)
  
imports: import io
  import os
  import sys
  import unittest
  import torch
  import torch.nn
  from torch.testing import FileCheck
  from typing import Any
  from torch.testing._internal.jit_utils import JitTestCase, make_global
  import torch.testing._internal.jit_utils
  from torch.testing._internal.common_utils import IS_SANDCASTLE, skipIfTorchDynamo
  from typing import List, Tuple, Iterable, Optional, Dict
label_desc: Use image node_id 17 for calling the TestClassType obj's underlying member method code with example usage: obj.test_python_interop() and returns: foo