parameters: (self, blocking=True, timeout=None)
return_statement: return rc
docstring: Acquire a semaphore, decrementing the internal counter by one.
  
          When invoked without arguments: if the internal counter is larger than
          zero on entry, decrement it by one and return immediately. If it is zero
          on entry, block, waiting until some other thread has called release() to
          make it larger than zero. This is done with proper interlocking so that
          if multiple acquire() calls are blocked, release() will wake exactly one
          of them up. The implementation may pick one at random, so the order in
          which blocked threads are awakened should not be relied on. There is no
          return value in this case.
  
          When invoked with blocking set to true, do the same thing as when called
          without arguments, and return true.
  
          When invoked with blocking set to false, do not block. If a call without
          an argument would block, return false immediately; otherwise, do the
          same thing as when called without arguments, and return true.
  
          When invoked with a timeout other than None, it will block for at
          most timeout seconds.  If acquire does not complete successfully in
          that interval, return false.  Return true otherwise.
docstring_summary: Acquire a semaphore, decrementing the internal counter by one.
docstring_tokens: Acquire a semaphore decrementing the internal counter by one .
function: def acquire(self, blocking=True, timeout=None):
          """Acquire a semaphore, decrementing the internal counter by one.
  
          When invoked without arguments: if the internal counter is larger than
          zero on entry, decrement it by one and return immediately. If it is zero
          on entry, block, waiting until some other thread has called release() to
          make it larger than zero. This is done with proper interlocking so that
          if multiple acquire() calls are blocked, release() will wake exactly one
          of them up. The implementation may pick one at random, so the order in
          which blocked threads are awakened should not be relied on. There is no
          return value in this case.
  
          When invoked with blocking set to true, do the same thing as when called
          without arguments, and return true.
  
          When invoked with blocking set to false, do not block. If a call without
          an argument would block, return false immediately; otherwise, do the
          same thing as when called without arguments, and return true.
  
          When invoked with a timeout other than None, it will block for at
          most timeout seconds.  If acquire does not complete successfully in
          that interval, return false.  Return true otherwise.
  
          """
          if not blocking and timeout is not None:
              raise ValueError("can't specify timeout for non-blocking acquire")
          rc = False
          endtime = None
          with self._cond:
              while self._value == 0:
                  if not blocking:
                      break
                  if timeout is not None:
                      if endtime is None:
                          endtime = _time() + timeout
                      else:
                          timeout = endtime - _time()
                          if timeout <= 0:
                              break
                  self._cond.wait(timeout)
              else:
                  self._value -= 1
                  rc = True
          return rc
function_tokens: def acquire ( self , blocking = True , timeout = None ) : if not blocking and timeout is not None : raise ValueError ( "can't specify timeout for non-blocking acquire" ) rc = False endtime = None with self . _cond : while self . _value == 0 : if not blocking : break if timeout is not None : if endtime is None : endtime = _time ( ) + timeout else : timeout = endtime - _time ( ) if timeout <= 0 : break self . _cond . wait ( timeout ) else : self . _value -= 1 rc = True return rc