def acquire(self, permits=1):
    '\n        Acquires one or specified amount of permits if available, and returns immediately, reducing the number of\n        available permits by one or given amount.\n\n        If insufficient permits are available then the current thread becomes disabled for thread scheduling purposes\n        and lies dormant until one of following happens:\n\n            * some other thread invokes one of the release methods for this semaphore, the current thread is next to be\n            assigned permits and the number of available permits satisfies this request,\n            * this Semaphore instance is destroyed, or\n            * some other thread interrupts the current thread.\n\n        :param permits: (int), the number of permits to acquire (optional).\n        '
    check_not_negative(permits, 'Permits cannot be negative!')
    return self._encode_invoke(semaphore_acquire_codec, permits=permits)
Acquires one or specified amount of permits if available, and returns immediately, reducing the number of
available permits by one or given amount.

If insufficient permits are available then the current thread becomes disabled for thread scheduling purposes
and lies dormant until one of following happens:

    * some other thread invokes one of the release methods for this semaphore, the current thread is next to be
    assigned permits and the number of available permits satisfies this request,
    * this Semaphore instance is destroyed, or
    * some other thread interrupts the current thread.

:param permits: (int), the number of permits to acquire (optional).
def acquire(self, permits=1):
    '\n        Acquires one or specified amount of permits if available, and returns immediately, reducing the number of\n        available permits by one or given amount.\n\n        If insufficient permits are available then the current thread becomes disabled for thread scheduling purposes\n        and lies dormant until one of following happens:\n\n            * some other thread invokes one of the release methods for this semaphore, the current thread is next to be\n            assigned permits and the number of available permits satisfies this request,\n            * this Semaphore instance is destroyed, or\n            * some other thread interrupts the current thread.\n\n        :param permits: (int), the number of permits to acquire (optional).\n        '
    check_not_negative(permits, 'Permits cannot be negative!')
    return self._encode_invoke(semaphore_acquire_codec, permits=permits)