class_docstr: this is a lock support check lock expiration, if you do not need check expiration, you can use SoftFileLock
code: def __init__(self, lock_file, stale=-1):
      super(__class__, self).__init__(lock_file, timeout=-1)
  
      # FIXME: hack
      if not hasattr(self, "_lock_file"):
          self._lock_file = self.lock_file
  
      self._lock_file_name = "{}.{}".format(
          self._lock_file, os.getpid()
      )
      self._stale = stale
  
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 1 to create a new SimplePreemptiveLock object from inherited base classes: filelock with example: obj = SimplePreemptiveLock(lock_file, stale)