code: def get_subprocess_lock_state(ctx, dir_name):
      q = ctx.Queue()
      p = ctx.Process(target=check_is_locked, args=(dir_name, q))
      p.start()
      result = q.get()
      p.join()
      return result
  
file_path: pytensor/tests/compile/test_compilelock.py
imports: import multiprocessing
  import os
  import sys
  import tempfile
  import threading
  import time
  import filelock
  import pytest
  from pytensor.compile.compilelock import force_unlock, local_mem, lock_ctx
label_desc: Use image node_id 3 for calling a global function with example usage: get_subprocess_lock_state(ctx, dir_name) and returns: result