code: def check_is_locked(dir_name, q):
      try:
          with lock_ctx(dir_name, timeout=0.1):
              q.put("unlocked")
      except filelock.Timeout:
          q.put("locked")
  
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 2 for calling a global function with example usage: check_is_locked(dir_name, q) without return types