code: def job_with_weakref(ex):
      class MyObject:
          hello = "world"
  
      a = MyObject()
      a_ref = ref(a)
      assert a_ref() is a
  
      def f(a_ref):
          a = a_ref()
          assert a is not None
          return a_ref().hello
  
      return ex.submit(f, ref(a))
  
file_path: submitit/submitit/test_pickle.py
imports: import pickle
  from weakref import ref
  import pytest
  from .local.debug import DebugExecutor
  from .local.local import LocalExecutor
label_desc: Use image node_id 1 for calling a global function with example usage: job_with_weakref(ex) and returns: ex, a_ref