class_docstr: this is a lock support check lock expiration, if you do not need check expiration, you can use SoftFileLock
code: def _acquire(self):
      open_mode = os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_TRUNC
      try:
          lock_file_names = glob.glob(self._lock_file + ".*")
          for file_name in lock_file_names:
              if os.path.exists(file_name) and (
                  self._stale < 0
                  or time.time() - os.stat(file_name).st_mtime
                  < self._stale
              ):
                  return None
          fd = os.open(self._lock_file_name, open_mode)
      except (IOError, OSError):
          pass
      else:
          self._lock_file_fd = fd
      return None
  
imports: import os
  import sys
  import json
  import tempfile
  import time
  import socket
  import string
  import random
  import glob
  from colorama import Fore
  import filelock
  import psutil
  import yaml
  from .constants import ERROR_INFO, NORMAL_INFO, WARNING_INFO
label_desc: Use image node_id 2 for calling the SimplePreemptiveLock obj's underlying member method code with example usage: obj._acquire() and returns: None, None