finds the instance(s) that correspond to the given vertex
509721
private Collection<IndexedInstance> getInstancesForVertex(Map<String, AttributeValueMap> map, AtlasVertex foundVertex) {

        //loop through the unique attributes.  For each attribute, check to see if the vertex property that
        //corresponds to that attribute has a value from one or more of the instances that were passed in.

        for(Map.Entry<String, AttributeValueMap> entry : map.entrySet()) {

            String propertyName = entry.getKey();
            AttributeValueMap valueMap = entry.getValue();

            Object vertexValue = foundVertex.getProperty(propertyName, Object.class);

            Collection<IndexedInstance> instances = valueMap.get(vertexValue);
            if(instances != null && instances.size() > 0) {
                //return first match.  Let the underling graph determine if this is a problem
                //(i.e. if the other unique attributes change be changed safely to match what
                //the user requested).
                return instances;
            }
            //try another attribute
        }
        return Collections.emptyList();
    }
199237
def find_connection(v1, v2)
      raise "not a vertex" unless v1.is_a?(Vertex) && v2.is_a?(Vertex)
      raise "Vertices not connected" if !is_connected?(v1, v2)
      connection = v1.edges.select {|edge| edge.connection.include?(v2)}
      raise "Error finding connection" if connection.length > 1
      connection.first
    end
429068
def ChiSquared(k: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().ChiSquaredVertex, label, cast_to_integer_vertex(k))
407122
private static int findOther(int[] vs, int u, int x) {
        for (int v : vs) {
            if (v != u && v != x) return v;
        }
        throw new IllegalArgumentException("vs[] did not contain another vertex");
    }
488398
def _get_vertices_neighbours(nets):
    
    zero_fn = (lambda: 0)
    vertices_neighbours = defaultdict(lambda: defaultdict(zero_fn))
    for net in nets:
        if net.weight != 0:
            for sink in net.sinks:
                vertices_neighbours[net.source][sink] += net.weight
                vertices_neighbours[sink][net.source] += net.weight
    return vertices_neighbours
676258
def equivalent(kls, first, second):
    
    if first.empty() and second.empty():
      return True
    elif first.vertices.shape[0] != second.vertices.shape[0]:
      return False
    elif first.edges.shape[0] != second.edges.shape[0]:
      return False

    EPSILON = 1e-7

    vertex1, inv1 = np.unique(first.vertices, axis=0, return_inverse=True)
    vertex2, inv2 = np.unique(second.vertices, axis=0, return_inverse=True)

    vertex_match = np.all(np.abs(vertex1 - vertex2) < EPSILON)
    if not vertex_match:
      return False

    remapping = {}
    for i in range(len(inv1)):
      remapping[inv1[i]] = inv2[i]
    remap = np.vectorize(lambda idx: remapping[idx])

    edges1 = np.sort(np.unique(first.edges, axis=0), axis=1)
    edges1 = edges1[np.lexsort(edges1[:,::-1].T)]

    edges2 = remap(second.edges)
    edges2 = np.sort(np.unique(edges2, axis=0), axis=1)
    edges2 = edges2[np.lexsort(edges2[:,::-1].T)]
    edges_match = np.all(edges1 == edges2)

    if not edges_match:
      return False

    second_verts = {}
    for i, vert in enumerate(second.vertices):
      second_verts[tuple(vert)] = i
    
    for i in range(len(first.radii)):
      i2 = second_verts[tuple(first.vertices[i])]

      if first.radii[i] != second.radii[i2]:
        return False

      if first.vertex_types[i] != second.vertex_types[i2]:
        return False

    return True
85219
def get_irregular_edge_by_vertex(graph, vertex):
    
    for edge in graph.get_edges_by_vertex(vertex):
        if edge.is_irregular_edge:
            return edge
    return None
312493
def each_vertex(filter=nil, &block)
      if filter.nil?
        @vertices.each &block
      else
        vertices(filter).each &block
      end
    end
909550
def _find_instances(self, cls):
        

        instances = collections.OrderedDict()

        for child_name, child in self._children.iteritems():

            if isinstance(child, cls):

                key_name = ".".join(child._get_path())

                instances[key_name] = child

                # Now check if the instance has children,
                # and if it does go deeper in the tree

                # NOTE: an empty dictionary evaluate as False

                if child._children:

                    instances.update(child._find_instances(cls))

            else:

                instances.update(child._find_instances(cls))

        return instances
7960
def vertices
	    (0...2*Math::PI).step(2*Math::PI/edge_count).map {|angle| center + Point[Math::cos(angle), Math::sin(angle)]*radius }
	end
813370
def get_vertex_faces(self):
        
        if self._vertex_faces is None:
            self._vertex_faces = [[] for i in xrange(len(self.get_vertices()))]
            for i in xrange(self._faces.shape[0]):
                face = self._faces[i]
                for ind in face:
                    self._vertex_faces[ind].append(i)
        return self._vertex_faces
462155
def from_edge_pairs(cls, vertices, edge_pairs):
        
        vertices = set(vertices)
        edges = set()
        heads = {}
        tails = {}

        # Number the edges arbitrarily.
        edge_identifier = itertools.count()
        for tail, head in edge_pairs:
            edge = next(edge_identifier)
            edges.add(edge)
            heads[edge] = head
            tails[edge] = tail

        return cls._raw(
            vertices=vertices,
            edges=edges,
            heads=heads,
            tails=tails,
        )
131630
def facets_by_vertex(self):
        
        if self._fbv_out is None:
            output = qhalf('Fv', self.halfspaces, self.interior_point)
            facets = []
            for l in output[1:]:
                facets.append([int(i) for i in l.split()[1:]])
            self._fbv_out = facets
        return self._fbv_out
873063
def children(self, vertex):
        
        return [self.head(edge) for edge in self.out_edges(vertex)]
1133883
def find_model(object):
        

        models = []
        for model in GraphModel._GraphModel__models_instances.itervalues():
            for node in foundations.walkers.nodes_walker(model.root_node):
                if node is object:
                    models.append(model)

                for attribute in node.get_attributes():
                    if attribute is object:
                        models.append(model)
        return models
1336966
def find_articulation_vertices(graph):
    

    articulation_vertices = []

    all_nodes = graph.get_all_node_ids()
    if len(all_nodes) == 0:
        return articulation_vertices

    # Run the algorithm on each of the connected components of the graph
    components = get_connected_components_as_subgraphs(graph)
    for component in components:
        # --Call the internal articulation vertices function to find
        # --the node list for this particular connected component
        vertex_list = _internal_get_cut_vertex_list(component)
        articulation_vertices.extend(vertex_list)

    return articulation_vertices
1018108
def has_vertex_color(self):
        """"""
        for v in (self._vertex_colors, self._vertex_colors_indexed_by_faces,
                  self._vertex_colors_indexed_by_edges):
            if v is not None:
                return True
        return False