'Acquire the lock. By defaults blocks and waits forever.
:param blocking: Block until lock is obtained or return immediately.
:type blocking: bool
:param timeout: Don\'t wait forever to acquire the lock.
:type timeout: float or None
:returns: Was the lock acquired?
:rtype: bool
:raises: :exc:`~kazoo.exceptions.LockTimeout` if the lock
wasn\'t acquired within `timeout` seconds.
.. versionadded:: 1.1
The timeout option.'

def acquire(self, blocking=True, timeout=None):

    try:
        retry = self._retry.copy()
        retry.deadline = timeout
        self.is_acquired = retry(self._inner_acquire, blocking=blocking, timeout=timeout)
    except RetryFailedError:
        self._best_effort_cleanup()
    except KazooException:
        self._best_effort_cleanup()
        self.cancelled = False
        raise
    if (not self.is_acquired):
        self._delete_node(self.node)
    return self.is_acquired
