If a node is started or paused return True
339979
def is_running(self):
        
        for node in self._nodes.values():
            # Some node type are always running we ignore them
            if node.status != "stopped" and not node.is_always_running():
                return True
        return False
291591
def is_continuous(docgraph, dominating_node):
    """"""
    first_onset, last_offset = get_span_offsets(docgraph, dominating_node)
    span_range = xrange(first_onset, last_offset+1)

    token_offsets = (docgraph.get_offsets(tok)
                     for tok in get_span(docgraph, dominating_node))
    char_positions = set(itertools.chain.from_iterable(xrange(on, off+1)
                         for on, off in token_offsets))
    for item in span_range:
        if item not in char_positions:
            return False
    return True
651295
def pause(self):
        
        log.info("Pausing cluster `%s` ...", self.name)
        failed = self._pause_all_nodes()
        if os.path.exists(self.known_hosts_file):
            os.remove(self.known_hosts_file)
        self.repository.save_or_update(self)
        if failed:
            log.warning(
                    "Not all cluster nodes have been successfully "
                    "stopped.  Some nodes may still be running - "
                    "check error messages above and consider "
                    "re-running `elasticluster pause %s` if "
                    "necessary.", self.name)
103127
def start(self, nodes=None):
        
        if not self.is_connected():
            return None

        nodes = nodes or self.nodes
        result = []

        for node in nodes:
            if node.state == 'running':
                logging.warning('Node %s is already "running".', node.name)
                continue
            try:
                status = self.gce.ex_start_node(node)
                if status:
                    result.append(node)
            except InvalidRequestError as err:
                raise ComputeEngineManagerException(err)

        return result
730411
def pause(self):
        
        if self.instance_id is None:
            raise ValueError("Trying to stop unstarted node.")
        resp = self._cloud_provider.pause_instance(self.instance_id)
        self.preferred_ip = None
        return resp
572770
def is_start_of_function(text):
    """"""
    if isinstance(text, str) or isinstance(text, unicode):
        function_prefix = ['def', 'async def']
        text = text.lstrip()

        for prefix in function_prefix:
            if text.startswith(prefix):
                return True

    return False
611950
def node_updated(self, node):
        
        if self._capture_node and node == self._capture_node["node"] and node.status != "started":
            yield from self.stop_capture()
1355902
def is_paused(self):
        
        root_is_paused = False
        if self.root_id != self.id:
            root_is_paused = context.connections.redis.sismember(redis_key("paused_queues"), self.root_id)

        return root_is_paused or context.connections.redis.sismember(redis_key("paused_queues"), self.id)
253121
@Override
    public void onNodeStarted(ZWaveNode node) {
        // save the newly started node
        logger.debug("Saving information for node {}", node.getNodeId());
        store.saveNode(node);

        // when a node moves to the "started" state, alert listeners that it's ready to be added
        onZWaveNodeAdded(node);
    }
238555
public void check(TreePath tp, boolean check) {
        CheckedNode cn = nodesCheckingState.get(tp);
        cn.isSelected = check;
        if (check) {
            checkedPaths.add(tp);
        } else {
            checkedPaths.remove(tp);
        }
        updatePredecessorsAllChildrenSelectedState(tp);
    }
924522
def on_startup(self):
        

        LOGGER.debug("> Calling '{0}' Component Framework 'on_startup' method.".format(self.__class__.__name__))

        self.refresh_nodes.emit()
        return True
445909
def recursively_preempt_states(self):
        
        self.preempted = True
        self.paused = False
        self.started = False
1017
def _pause_all_nodes(self, max_thread_pool_size=0):
        
        failed = 0

        def _pause_specific_node(node):
            if not node.instance_id:
                log.warning("Node `%s` has no instance id."
                            " It is either already stopped, or"
                            " never created properly.  Not attempting"
                            " to stop it again.", node.name)
                return None
            try:
                return node.pause()
            except Exception as err:
                log.error(
                    "Could not stop node `%s` (instance ID `%s`): %s %s",
                    node.name, node.instance_id, err, err.__class__)
                node.update_ips()
                return None

        nodes = self.get_all_nodes()
        thread_pool = self._make_thread_pool(max_thread_pool_size)
        for node, state in zip(nodes, thread_pool.map(_pause_specific_node, nodes)):
            if state is None:
                failed += 1
            else:
                self.paused_nodes[node.name] = state

        return failed
48079
def node_is_on_list(self, node):
        
        next = self.node_next(node)
        if next == node or next is None:
            assert(self.node_prev(node) is next)
            return False

        return True
1017447
def has_pending(self):
        
        if self.pending:
            return True
        for pending in self.node2pending.values():
            if pending:
                return True
        return False
288571
def wait_until(name, state, timeout=300):
    '''
    
    '''
    start_time = time.time()
    node = show_instance(name, call='action')
    while True:
        if node['state'] == state:
            return True
        time.sleep(1)
        if time.time() - start_time > timeout:
            return False
        node = show_instance(name, call='action')
1225508
def ensure_started(self):
        """"""
        if self.active:
            return self
        self._observer = self._observer_class(**self._observer_params)
        self.start()
        self._active = True
        return self