class_docstr: A reentrant lock, functions in a similar way to threading.RLock in that it
  can be acquired multiple times.  When the corresponding number of release()
  calls are made the lock will finally release the underlying file lock.
code: def acquire(
      self, timeout=None, check_interval=None, fail_when_locked=None
  ):
      if self._lock:
          # cleanup bad python behaviour when forking while lock is acquired
          # see Issue https://github.com/allegroai/clearml-agent/issues/73
          # and https://bugs.python.org/issue6721
          if self._pid != os.getpid():
              # noinspection PyBroadException
              try:
                  if self._lock._semlock._count():  # noqa
                      # this should never happen unless python forgot calling _after_fork
                      self._lock._semlock._after_fork()  # noqa
              except BaseException:
                  pass
  
          if not self._lock.acquire(
              block=timeout != 0, timeout=timeout
          ):
              # We got a timeout... reraising
              raise exceptions.LockException()
  
      # check if we need to recreate the file lock on another subprocess
      if self._pid != os.getpid():
          self._pid = os.getpid()
          self._acquire_count = 0
          if self.fh:
              # noinspection PyBroadException
              try:
                  portalocker.unlock(self.fh)
                  self.fh.close()
              except Exception:
                  pass
          self.fh = None
  
      if self._acquire_count >= 1:
          fh = self.fh
      else:
          fh = super(RLock, self).acquire(
              timeout, check_interval, fail_when_locked
          )
  
      self._acquire_count += 1
      return fh
  
imports: import os
  import time
  import atexit
  import tempfile
  import contextlib
  from multiprocessing import RLock
  from .None import exceptions
  from .None import constants
  from .None import portalocker
label_desc: Use image node_id 2 for calling the RLock obj's underlying member method code with example usage: obj.acquire(timeout, check_interval, fail_when_locked) and returns: fh