code: def test_filelock():
      temp_dir = tempfile.mkdtemp()
      lock_path = os.path.join(temp_dir, "file.lock")
      out_file_path = os.path.join(temp_dir, "out.txt")
  
      process_count = 5
      processes = []
      for i in range(process_count):
          process = multiprocessing.Process(
              target=_acquire_lock, args=(lock_path, out_file_path)
          )
          process.start()
          processes.append(process)
  
      for process in processes:
          process.join()
  
      pids = []
      times = []
      with open(out_file_path) as out:
          content = out.read()
          logging.info("Times:\n%s", content)
          for line in content.strip().split("\n"):
              pid, time_val = line.split(":")
              pids.append(pid)
              times.append(float(time_val))
  
      assert len(set(pids)) == process_count
      time1 = times.pop()
      while times:
          time2 = times.pop()
          assert int(time1) - int(time2) >= 2
          time1 = time2
  
file_path: catboost/library/python/filelock/ut/test_filelock.py
imports: import os
  import time
  import logging
  import multiprocessing
  import tempfile
  import threading
  import library.python.filelock
label_desc: Use image node_id 2 for calling a global function with example usage: test_filelock() without return types