code: def test_issue_75():
      def function_with_local_type():
          class A:
              pass
  
          a = A()
          assert a == Promise.resolve(a).get()
  
          return weakref.ref(A)
  
      weak_reference = function_with_local_type()
  
      # The local type 'A' from the function is still kept alive by reference cycles.
      gc.collect()
  
      # Now the local type should have been garbage collected,
      # such that the weak reference should be invalid.
      assert not weak_reference()
  
file_path: wandb/wandb/vendor/promise-2.3.0/tests/test_issues.py
imports: from concurrent.futures import ThreadPoolExecutor
  from promise import Promise
  import time
  import weakref
  import gc
label_desc: Use image node_id 8 for calling a global function with example usage: test_issue_75() and returns: weakref