code: def acquire(self, blocking=True, timeout=-1):
          
          if not isinstance(timeout, (int, float)):
              raise TypeError('a float is required')
  
          if blocking:
              # blocking indefinite
              if timeout == -1:
                  with self.__condition:
                      while not self.__lock.acquire(False):
                          # condition with timeout is interruptable
                          self.__condition.wait(60)
                  return True
  
              # same as non-blocking
              elif timeout == 0:
                  return self.__lock.acquire(False)
  
              elif timeout < 0:
                  raise ValueError('timeout value must be strictly positive (or -1)')
  
              # blocking finite
              else:
                  start = time()
                  waited_time = 0
                  with self.__condition:
                      while waited_time < timeout:
                          if self.__lock.acquire(False):
                              return True
                          else:
                              self.__condition.wait(timeout - waited_time)
                              waited_time = time() - start
                  return False
  
          elif timeout != -1:
              raise ValueError('can\'t specify a timeout for a non-blocking call')
  
          else:
              # non-blocking
              return self.__lock.acquire(False)
docs: Acquire a lock, blocking or non-blocking.
          Blocks until timeout, if timeout a positive float and blocking=True. A timeout
          value of -1 blocks indefinitely, unless blocking=False.