def acquire(self, callback, *partial_args, **partial_kwargs):
        """Acquire semaphore, applying ``callback`` if
        the resource is available.

        :param callback: The callback to apply.
        :param \*partial_args: partial arguments to callback.

        """
        value = self.value
        if value <= 0:
            self._add_waiter((callback, partial_args, partial_kwargs))
            return False
        else:
            self.value = max(value - 1, 0)
            callback(*partial_args, **partial_kwargs)
            return True
dataset/ETHPy150Open celery/kombu/kombu/async/semaphore.py/LaxBoundedSemaphore.acquire/original