code: def acquire(self, block=True):
          
          while True:
              acquired = self.database.run_script(
                  'lock_acquire',
                  keys=[self.key],
                  args=[self._lock_id, self.ttl])
              if acquired == 1 or not block:
                  return acquired == 1
  
              # Perform a blocking pop on the event key. When a lock
              # is released, a value is pushed into the list, which
              # signals listeners that the lock is available.
              self.database.blpop(self.event, self.ttl)
docs: Acquire the lock. The lock will be held until it is released
          by calling :py:meth:`Lock.release`. If the lock was
          initialized with a ``ttl``, then the lock will be released
          automatically after the given number of milliseconds.
  
          By default this method will block until the lock becomes
          free (either by being released or expiring). The blocking is
          accomplished by performing a blocking left-pop on a list, as
          opposed to a spin-loop.
  
          If you specify ``block=False``, then the method will return
          ``False`` if the lock could not be acquired.
  
          :param bool block: Whether to block while waiting to acquire
              the lock.
          :returns: Returns ``True`` if the lock was acquired.