(self)
return True
Acquire a semaphore.

        If the internal counter is larger than zero on entry,
        decrement it by one and return True immediately.  If it is
        zero on entry, block, waiting until some other coroutine has
        called release() to make it larger than 0, and then return
        True.
Acquire a semaphore.
Acquire a semaphore .
async def acquire(self):
        """Acquire a semaphore.

        If the internal counter is larger than zero on entry,
        decrement it by one and return True immediately.  If it is
        zero on entry, block, waiting until some other coroutine has
        called release() to make it larger than 0, and then return
        True.
        """
        while self._value <= 0:
            fut = self._get_loop().create_future()
            self._waiters.append(fut)
            try:
                await fut
            except:
                # See the similar code in Queue.get.
                fut.cancel()
                if self._value > 0 and not fut.cancelled():
                    self._wake_up_next()
                raise
        self._value -= 1
        return True
async def acquire ( self ) : while self . _value <= 0 : fut = self . _get_loop ( ) . create_future ( ) self . _waiters . append ( fut ) try : await fut except : # See the similar code in Queue.get. fut . cancel ( ) if self . _value > 0 and not fut . cancelled ( ) : self . _wake_up_next ( ) raise self . _value -= 1 return True