code: def lock(self, name, ttl=None, lock_id=None):
          
          return Lock(self, name, ttl, lock_id)
docs: Create a named :py:class:`Lock` instance. The lock implements
          an API similar to the standard library's ``threading.Lock``,
          and can also be used as a context manager or decorator.
  
          :param str name: The name of the lock.
          :param int ttl: The time-to-live for the lock in milliseconds
              (optional). If the ttl is ``None`` then the lock will not
              expire.
          :param str lock_id: Optional identifier for the lock instance.