code: def _start_wait_process(lock_path, duration_s):
      script_path = os.path.join(
          TEST_DIR, "assets", "resources", "lock.py"
      )
      result = None
  
      def run():
          nonlocal result
          try:
              cmd = [
                  sys.executable,
                  script_path,
                  lock_path,
                  str(duration_s),
              ]
              p = subprocess.Popen(
                  cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
              )
              stdout, _ = p.communicate()
              stdout = stdout.decode("utf-8")
              if p.returncode:
                  print("ERROR", p.returncode, stdout, flush=True)
                  raise Exception("lock.py failed")
              result = stdout
          except Exception:
              traceback.print_exc()
  
      t = threading.Thread(target=run)
      t.daemon = True
      t.start()
  
      def join():
          t.join()
          return result
  
      return join
  
file_path: modelkit/tests/assets/test_lock.py
imports: import os
  import subprocess
  import sys
  import threading
  import traceback
  from modelkit.assets.remote import StorageProvider
  from tests import TEST_DIR
label_desc: Use image node_id 1 for calling a global function with example usage: _start_wait_process(lock_path, duration_s) and returns: join, result