Close a node

        :param node_id: Node identifier

        :returns: Node instance
322888
def close_node(self, node_id):
        

        node = self.get_node(node_id)
        if asyncio.iscoroutinefunction(node.close):
            yield from node.close()
        else:
            node.close()
        return node
70480
def _remove_node(self, node):
        

        self.graph.remove_node(node)
        if node.addr in self._nodes:
            del self._nodes[node.addr]

        # We wanna remove the function as well
        if node.addr in self.kb.functions:
            del self.kb.functions[node.addr]

        if node.addr in self.kb.functions.callgraph:
            self.kb.functions.callgraph.remove_node(node.addr)
796111
def delete_node(self, node: str):
        
        if self.has_node(node):
            self.remove_node(node)
595785
def project_closed(self, project):
        

        for node in project.nodes:
            if node.id in self._nodes:
                del self._nodes[node.id]
489585
public NodeConfig setId(NodeId id) {
    this.id = id != null ? id : NodeId.anonymous();
    return this;
  }
1048840
def mark_done(self, node_id):
        
        with self.lock:
            self.in_progress.remove(node_id)
            self.graph.remove_node(node_id)
            self._find_new_additions()
            self.inner.task_done()
686332
static void removeClosedChannel(String nodeId) {
        if (lock.tryLock()) {
            try {
                nodeId_to_connectedChannel_map.remove(nodeId);
                LOG.info(String.format("RpcClient:与%s的空闲长连接缓存释放完毕...", nodeId));
            } finally {
                lock.unlock();
            }
        } else {
            LOG.info(String.format("RpcClient删除缓存的与%s的废弃的连接：已经有新连接正在建立，那么这里不做操作，由新建连接的线程去覆盖掉缓存中的废弃连接", nodeId));
        }
    }
1140388
def get(self, node_id):
        
        if (self._registry[node_id].monotonic_timestamp + self.TIMEOUT) < time.monotonic():
            self._call_event_handlers(self.UpdateEvent(self._registry[node_id],
                                                       self.UpdateEvent.EVENT_ID_OFFLINE))
            del self._registry[node_id]
        return self._registry[node_id]
922443
def _remove_node(self, node_name):
        
        try:
            self._nodes.pop(node_name)
        except Exception:
            raise KeyError('node \'{}\' not found, available nodes: {}'.format(
                node_name, self._nodes.keys()))
        else:
            self._create_ring(self._nodes)
277889
def _del_tip(self, node_id):
        """"""
        self.nodes_deleted.append(node_id)
        etp = self._edge_by_target.get(node_id)
        assert etp is not None
        source_id, target_id = self._del_edge(etp)
        assert target_id == node_id
        return source_id
679263
def close(self, node_id=None):
        
        with self._lock:
            if node_id is None:
                self._close()
                conns = list(self._conns.values())
                self._conns.clear()
                for conn in conns:
                    conn.close()
            elif node_id in self._conns:
                self._conns.pop(node_id).close()
            else:
                log.warning("Node %s not found in current connection list; skipping", node_id)
                return
849536
def disconnect():
    
    post_save.disconnect(node_created_handler, sender=Node)
    node_status_changed.disconnect(node_status_changed_handler)
    pre_delete.disconnect(node_deleted_handler, sender=Node)
1048917
def publish_topology_closed(self, topology_id):
        
        event = TopologyClosedEvent(topology_id)
        for subscriber in self.__topology_listeners:
            try:
                subscriber.closed(event)
            except Exception:
                _handle_exception()
509909
def stop_instance(self, instance_id):
        
        instance = self._load_instance(instance_id)
        instance.terminate()
        del self._instances[instance_id]
1093725
def exit(self, pub_id, *node_ids):
        ''''''
        try:
            pub = self['pubs'][pub_id]
        except KeyError:
            raise ValueError('Pub {} is not available'.format(pub_id))
        for node_id in node_ids:
            node = self.get_agent(node_id)
            if pub_id == node['pub']:
                del node['pub']
                pub['occupancy'] -= 1
734857
def delete_node(node_id, purge_data,**kwargs):
    
    user_id = kwargs.get('user_id')
    try:
        node_i = db.DBSession.query(Node).filter(Node.id == node_id).one()
    except NoResultFound:
        raise ResourceNotFoundError("Node %s not found"%(node_id))

    group_items = db.DBSession.query(ResourceGroupItem).filter(
                                        ResourceGroupItem.node_id==node_id).all()
    for gi in group_items:
        db.DBSession.delete(gi)

    if purge_data == 'Y':
        _purge_datasets_unique_to_resource('NODE', node_id)

    log.info("Deleting node %s, id=%s", node_i.name, node_id)

    node_i.network.check_write_permission(user_id)
    db.DBSession.delete(node_i)
    db.DBSession.flush()
    return 'OK'
1239597
def get_node_by_id(self, node_id):
        
        tmp_nodes = self.diagram_graph.nodes(data=True)
        for node in tmp_nodes:
            if node[0] == node_id:
                return node