Delete big nodes with many connections from the graph.
8646
def del_big_nodes(self, grater_than=215):
        """"""
        G = self._graph
        it = G.nodes_iter()
        node_paths = []
        node_names = []
        del_nodes = []
        summe = 1
        count = 1
        for node in it:
            l = len(G[node])
            if l > grater_than:
                del_nodes.append(node)
                continue
            summe += l
            node_names.append(node)
            node_paths.append(l)
            count += 1
        for node in del_nodes:
            G.remove_node(node)
            if node > 1000000000:
                self.valid_user.pop(node)

        print("Nodes deleted: {}".format(len(del_nodes)))
312203
private void destroyConnLinks() {
        synchronized (inUse) {
            int numlinks = inUse.size();
            for (int i = 0; i < numlinks; i++) {
                inUse.removeFirst().destroy(null);
            }
        }
    }
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)
725917
public void clear() {
        // Clearing all of the links between nodes is "unnecessary", but:
        // - helps a generational GC if the discarded nodes inhabit
        //   more than one generation
        // - is sure to free memory even if there is a reachable Iterator
        for (Node<E> x = first; x != null; ) {
            Node<E> next = x.next;
            x.item = null;
            x.next = null;
            x.prev = null;
            x = next;
        }
        first = last = null;
        size = 0;
        modCount++;
    }
674006
private function pruneNodeCache(): void
    {
        if ($this->maxItems > 0 && count($this->nodes) > $this->maxItems) {
            $this->nodes = array_slice($this->nodes, (int)($this->maxItems * 0.2), null, true);
        }
    }
813453
def remove(self, *args):
        '''
        
        '''
        return Plan(reduce(lambda m,k: m.remove(k), args, self.nodes))
1243697
def delete(self):
        
        if self.parent.buffered:
            query = 'CLEAR SILENT GRAPH %s ;' % self.identifier.n3()
            self.parent.graph.update(query)
            self.flush()
        else:
            self.graph.remove((None, None, None))
131588
def disconnect(self):
        
        all_conns = chain(
            self._available_connections.values(),
            self._in_use_connections.values(),
        )

        for node_connections in all_conns:
            for connection in node_connections:
                connection.disconnect()
1004493
def remove_isolated_nodes_op(graph):
    
    rv = graph.copy()
    nodes = list(nx.isolates(rv))
    rv.remove_nodes_from(nodes)
    return rv
5191
void disconnectSingleConnections() {

		List<SquareNode> open = new ArrayList<>();
		List<SquareNode> open2 = new ArrayList<>();

		for (int i = 0; i < nodes.size(); i++) {
			SquareNode n = nodes.get(i);
			checkDisconnectSingleEdge(open, n);
		}


		while( !open.isEmpty() ) {
			for (int i = 0; i < open.size(); i++) {
				SquareNode n = open.get(i);
				checkDisconnectSingleEdge(open2, n);

				open.clear();
				List<SquareNode> tmp = open;
				open = open2;
				open2 = tmp;
			}
		}
	}
410299
def delete_network(self, network):
        """"""
        n_res = MechResource(network['id'], a_const.NETWORK_RESOURCE,
                             a_const.DELETE)
        self.provision_queue.put(n_res)
540171
def delete_node(self, node_id):
        """"""
        node = self.get_node(node_id)

        # Remove all edges from the node
        for e in node['edges']:
            self.delete_edge_by_id(e)

        # Remove all edges to the node
        edges = [edge_id for edge_id, edge in list(self.edges.items()) if edge['vertices'][1] == node_id]
        for e in edges:
            self.delete_edge_by_id(e)

        # Remove the node from the node list
        del self.nodes[node_id]

        self._num_nodes -= 1
1017012
def del_node(self, node):
        
        for each in list(self.incidents(node)):
            # Delete all the edges incident on this node
            self.del_edge((each, node))
            
        for each in list(self.neighbors(node)):
            # Delete all the edges pointing to this node.
            self.del_edge((node, each))
        
        # Remove this node from the neighbors and incidents tables   
        del(self.node_neighbors[node])
        del(self.node_incidence[node])
        
        # Remove any labeling which may exist.
        self.del_node_labeling( node )
1301550
@VisibleForTesting
    @Synchronized
    public void pruneUnusedConnections() {
        for (List<Connection> connections : connectionMap.values()) {
            for (Iterator<Connection> iterator = connections.iterator(); iterator.hasNext();) {
                Connection connection = iterator.next();
                if (isUnused(connection)) {
                    connection.getFlowHandler().close();
                    iterator.remove();
                }
            }
        }
    }
674503
def unlink(self, subj=None, predicate=None):
        
        self.graph.remove((subj, predicate, self.asNode()))
372884
def clean_networks(networks: Iterable[str] = None) -> Optional[Iterable[str]]:
    
    if not networks:
        return networks
    if not isinstance(networks, list):
        raise TypeError("networks parameter must be a list.")

    result = []
    for n in networks:
        if isinstance(n, str):
            n = {"Target": n}
        result.append(n)
    return result
444789
def clear(self):
        
        self.adj.clear()
        self.node.clear()
        self.graph.clear()