def _refain_locks(self, locks, id):
    'Cancel/release previously requested/acquired locks\n\n        Parameters\n        ----------\n        locks: List[str]\n            Names of the locks to refain.\n        id: Hashable\n            Identifier of the `MultiLock` instance refraining the locks.\n        '
    waiters_ready = set()
    for lock in locks:
        if (self.locks[lock][0] == id):
            self.locks[lock].pop(0)
            if self.locks[lock]:
                new_first = self.locks[lock][0]
                self.requests_left[new_first] -= 1
                if (self.requests_left[new_first] <= 0):
                    self.requests_left[new_first] = 0
                    waiters_ready.add(new_first)
        else:
            self.locks[lock].remove(id)
        assert (id not in self.locks[lock])
    del self.requests[id]
    del self.requests_left[id]
    for waiter in waiters_ready:
        self.scheduler.loop.add_callback(self.events[waiter].set)
Cancel/release previously requested/acquired locks

Parameters
----------
locks: List[str]
    Names of the locks to refain.
id: Hashable
    Identifier of the `MultiLock` instance refraining the locks.
def _refain_locks(self, locks, id):
    'Cancel/release previously requested/acquired locks\n\n        Parameters\n        ----------\n        locks: List[str]\n            Names of the locks to refain.\n        id: Hashable\n            Identifier of the `MultiLock` instance refraining the locks.\n        '
    waiters_ready = set()
    for lock in locks:
        if (self.locks[lock][0] == id):
            self.locks[lock].pop(0)
            if self.locks[lock]:
                new_first = self.locks[lock][0]
                self.requests_left[new_first] -= 1
                if (self.requests_left[new_first] <= 0):
                    self.requests_left[new_first] = 0
                    waiters_ready.add(new_first)
        else:
            self.locks[lock].remove(id)
        assert (id not in self.locks[lock])
    del self.requests[id]
    del self.requests_left[id]
    for waiter in waiters_ready:
        self.scheduler.loop.add_callback(self.events[waiter].set)