<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _check_starting_nodes(self, nodes, lapse):
 """ Wait until all given nodes are alive, for max `lapse` seconds. """

        with timeout(lapse, raise_timeout_error):
            try:
                while nodes:
                    nodes = set(node for node in nodes
                                if not node.is_alive())
                    if nodes:
                        log.debug("Waiting for %d more nodes to come up ...", len(nodes))
                        time.sleep(self.polling_interval)
            except TimeoutError:
                log.error("Some nodes did not start correctly"
                          " within the given %d-seconds timeout: %s",
                          lapse, ', '.join(node.name for node in nodes))
        # return list of not-yet-started nodes,
        # so we can exclude them from coming rounds
        return nodes