'Called when in allocating mode, and the children settled'

def _allocate_transition(self, result):

    if result.exception:
        self._fail_out()
        return
    (children, async_result) = result.get()
    self._children_updated = False
    def updated(result):
        with self._state_change:
            if self.acquired:
                self.state = PartitionState.RELEASE
        self._children_updated = True
    async_result.rawlink(updated)
    self._partition_set = self._partition_func(self._identifier, list(self._party), self._set)
    for member in self._partition_set:
        if (self._children_updated or self.failed):
            return self._abort_lock_acquisition()
        lock = self._client.Lock(((self._lock_path + '/') + str(member)))
        try:
            lock.acquire()
        except KazooException:
            return self.finish()
        self._locks.append(lock)
    with self._state_change:
        if self.failed:
            return self.finish()
        self.state = PartitionState.ACQUIRED
        self._acquire_event.set()
