def acquire(self, blocking=True):
        blocking, timeout = utils.convert_blocking(blocking)
        if timeout is not None:
            watch = timeutils.StopWatch(duration=timeout)
            watch.start()
        else:
            watch = None

        while True:
            try:
                reply = self.client.put(
                    self._lock_url,
                    make_url=False,
                    timeout=watch.leftover() if watch else None,
                    data={"ttl": self.ttl,
                          "prevExist": "false"})
            except requests.exceptions.RequestException:
                if watch and watch.leftover() == 0:
                    return False

            # We got the lock!
            if reply.get("errorCode") is None:
                self._node = reply['node']
                self.coord._acquired_locks.append(self)
                return True

            # We didn't get the lock and we don't want to wait
            if not blocking:
                return False

            # Ok, so let's wait a bit (or forever!)
            try:
                reply = self.client.get(
                    self._lock_url +
                    reply['index'] % "?wait=true&waitIndex=%d",
                    make_url=False,
                    timeout=watch.leftover() if watch else None)
            except requests.exceptions.RequestException:
                if watch and watch.expired():
                    return False
dataset/ETHPy150Open openstack/tooz/tooz/drivers/etcd.py/EtcdLock.acquire/swapped operands of `%`