Make the graph a complete graph.
        
        @attention: This will modify the current graph.
972902
def complete(self):
        
        for each in self.nodes():
            for other in self.nodes():
                if (each != other and not self.has_edge((each, other))):
                    self.add_edge((each, other))
1058936
def _maintain_dep_graph(self, p_todo):
        
        dep_id = p_todo.tag_value('id')
        # maintain dependency graph
        if dep_id:
            self._parentdict[dep_id] = p_todo
            self._depgraph.add_node(hash(p_todo))

            # connect all tasks we have in memory so far that refer to this
            # task
            for dep in \
                    [dep for dep in self._todos if dep.has_tag('p', dep_id)]:

                self._add_edge(p_todo, dep, dep_id)

        for dep_id in p_todo.tag_values('p'):
            try:
                parent = self._parentdict[dep_id]
                self._add_edge(parent, p_todo, dep_id)
            except KeyError:
                pass
105725
def graph(self, **kw):
        
        self.name = kw.get('name', 'G')
        self.fillcolor = kw.get('fillcolor', '#ffffff')
        self.fontcolor = kw.get('fontcolor', '#000000')
        self.rankdir = kw.get('rankdir', 'BT' if self.reverse else 'TB')
        if kw.get('concentrate', True):
            self.concentrate = 'concentrate = true;'
        else:
            self.concentrate = ''
        self.dedent("""
            digraph {self.name} {{
                {self.concentrate}
                rankdir = {self.rankdir};
                node [style=filled,fillcolor="{self.fillcolor}",fontcolor="{self.fontcolor}",fontname=Helvetica,fontsize=10];

        """.format(self=self))
        yield
        self.writeln('}')
832835
def finalize(self, **kwargs):
        
        # Set the title
        self.set_title(
            'Count of Missing Values by Column'
        )
        tick_locations = np.arange(len(self.features_))  # the x locations for the groups
        self.ax.set_yticks(tick_locations)
        self.ax.set_yticklabels(self.get_feature_names())
        # Remove the ticks from the graph
        self.ax.set_xlabel('Count')

        self.ax.legend(loc='best')
551702
public function isComplete()
    {
        // copy of array (separate iterator but same vertices)
        $c = $vertices = $this->graph->getVertices()->getVector();
        // from each vertex
        foreach ($vertices as $vertex) {
            // to each vertex
            foreach ($c as $other) {
                // missing edge => fail
                if ($other !== $vertex && !$vertex->hasEdgeTo($other)) {
                    return false;
                }
            }
        }

        return true;
    }
366273
def _post_analysis(self):
        

        self._make_completed_functions()
        new_changes = self._iteratively_analyze_function_features()
        functions_do_not_return = new_changes['functions_do_not_return']
        self._update_function_callsites(functions_do_not_return)

        # Create all pending edges
        for _, edges in self._pending_edges.items():
            for src_node, dst_node, data in edges:
                self._graph_add_edge(src_node, dst_node, **data)

        # Remove those edges that will never be taken!
        self._remove_non_return_edges()

        CFGBase._post_analysis(self)
642421
def _create_graph(self, upgrades, history=None):
        
        history = history or {}
        graph_incoming = {}  # nodes their incoming edges
        graph_outgoing = {}  # nodes their outgoing edges

        # Create graph data structure
        for mod in six.itervalues(upgrades):
            # Remove all incoming edges from already applied upgrades
            graph_incoming[mod.name] = [x for x in mod.depends_on
                                        if x not in history]
            # Build graph_outgoing
            if mod.name not in graph_outgoing:
                graph_outgoing[mod.name] = []
            for edge in graph_incoming[mod.name]:
                if edge not in graph_outgoing:
                    graph_outgoing[edge] = []
                graph_outgoing[edge].append(mod.name)

        return (graph_incoming, graph_outgoing)
956527
def graph(self, name, *args, **kwargs):
        
        return Graph(self, name, *args, **kwargs)
657441
def as_graph(self, depth=0):
        
        if depth in self._graph_cache:
            return self._graph_cache[depth]
        self._graph_cache[depth] = graph = Graph(self, depth=depth)
        return graph
488396
def remove_vertex(vertex)
      @vertices[vertex].each do |edge|
        remove_edge(edge) if edge.include?(vertex)
      end
      delete_vertex(vertex)
      callback(vertex, :removed_from_graph, self)
    end
175193
def execute
      graph = Digraph.new{|g|
        vertex_count.times do |i|
          vertex = g.add_vertex
          vertex_builder.call(vertex,i) if vertex_builder
        end
        edge_count.times do |i|
          source = g.ith_vertex(Kernel.rand(vertex_count))
          target = g.ith_vertex(Kernel.rand(vertex_count))
          edge = g.connect(source, target)
          edge_builder.call(edge,i) if edge_builder
        end
      }
      strip ? _strip(graph) : graph
    end
798707
def build_current_graph():
    
    graph = SQLStateGraph()
    for app_name, config in apps.app_configs.items():
        try:
            module = import_module(
                '.'.join((config.module.__name__, SQL_CONFIG_MODULE)))
            sql_items = module.sql_items
        except (ImportError, AttributeError):
            continue
        for sql_item in sql_items:
            graph.add_node((app_name, sql_item.name), sql_item)

            for dep in sql_item.dependencies:
                graph.add_lazy_dependency((app_name, sql_item.name), dep)

    graph.build_graph()
    return graph
444789
def clear(self):
        
        self.adj.clear()
        self.node.clear()
        self.graph.clear()
627319
def to_adjacency
      result = (directed? ? DirectedAdjacencyGraph : AdjacencyGraph).new
      each_vertex { |v| result.add_vertex(v) }
      each_edge { |u,v| result.add_edge(u, v) }
      result
    end
128985
def _create_graph(self, return_target_sources=None):
        
        if return_target_sources is None:
            # We set it to a defaultdict in order to be consistent with the
            # actual parameter.
            return_target_sources = defaultdict(list)

        cfg = networkx.DiGraph()
        # The corner case: add a node to the graph if there is only one block
        if len(self._nodes) == 1:
            cfg.add_node(self._nodes[next(iter(self._nodes.keys()))])

        # Adding edges
        for tpl, targets in self._exit_targets.items():
            basic_block = self._nodes[tpl] # Cannot fail :)
            for ex, jumpkind in targets:
                if ex in self._nodes:
                    target_bbl = self._nodes[ex]
                    cfg.add_edge(basic_block, target_bbl, jumpkind=jumpkind)

                    # Add edges for possibly missing returns
                    if basic_block.addr in return_target_sources:
                        for src_irsb_key in \
                                return_target_sources[basic_block.addr]:
                            cfg.add_edge(self._nodes[src_irsb_key],
                                               basic_block, jumpkind="Ijk_Ret")
                else:
                    # Debugging output
                    def addr_formalize(addr):
                        if addr is None:
                            return "None"
                        else:
                            return "%#08x" % addr

                    s = "(["
                    for addr in ex[:-1]:
                        s += addr_formalize(addr) + ", "
                    s += "] %s)" % addr_formalize(ex[-1])
                    l.warning("Key %s does not exist.", s)

        return cfg
1068042
private void updateLastSeenEdge(Vertex v) {
    Edge lastSeenEdge = getLastSeenEdge();
    if (lastSeenEdge != null) {
      if (lastSeenEdge.getSourceVertexId() == null) {
        lastSeenEdge.setSourceVertexId(v.getId());
      } else if (lastSeenEdge.getTargetVertexId() == null) {
        lastSeenEdge.setTargetVertexId(v.getId());
      }
    }
  }
363160
def _add_to_graph(self, term, parents):
        
        if self._frozen:
            raise ValueError(
                "Can't mutate %s after construction." % type(self).__name__
            )

        # If we've seen this node already as a parent of the current traversal,
        # it means we have an unsatisifiable dependency.  This should only be
        # possible if the term's inputs are mutated after construction.
        if term in parents:
            raise CyclicDependency(term)

        parents.add(term)

        self.graph.add_node(term)

        for dependency in term.dependencies:
            self._add_to_graph(dependency, parents)
            self.graph.add_edge(dependency, term)

        parents.remove(term)