Retrieves an existing edge from the graph
        @params _id: Edge unique identifier

        @returns The requested Edge or None
764048
def getEdge(self, _id):
        """"""
        try:
            edge = self.neograph.relationships.get(_id)
        except client.NotFoundError:
            return None
        return Edge(edge)
169707
def usable_id(cls, id):
        
        try:
            # id is maybe a sshkey name
            qry_id = cls.from_name(id)
            if not qry_id:
                qry_id = int(id)
        except DuplicateResults as exc:
            cls.error(exc.errors)
        except Exception:
            qry_id = None

        if not qry_id:
            msg = 'unknown identifier %s' % id
            cls.error(msg)

        return qry_id
93491
private ODocument getEdgeWithPossibleId(String start, String end, List<String> ids) {
        List<ODocument> edges = getEdgesBetweenModels(start, end);
        for (ODocument edge : edges) {
            if (ids.contains(OrientModelGraphUtils.getIdFieldValue(edge))) {
                return edge;
            }
        }
        return edges.size() != 0 ? edges.get(0) : null;
    }
385374
def remove_duplicate_edges_directed(dg):
    """"""
    # With directed edges, we can just hash the to and from node id tuples and if
    # a node happens to conflict with one that already exists, we delete it

    # --For aesthetic, we sort the edge ids so that lower edge ids are kept
    lookup = {}
    edges = sorted(dg.get_all_edge_ids())
    for edge_id in edges:
        e = dg.get_edge(edge_id)
        tpl = e['vertices']
        if tpl in lookup:
            dg.delete_edge_by_id(edge_id)
        else:
            lookup[tpl] = edge_id
34590
def get_polygon(self, polygon_id):
        
        status, data = self.http_client.get_json(
            NAMED_POLYGON_URI % str(polygon_id),
            params={'appid': self.API_key},
            headers={'Content-Type': 'application/json'})
        return Polygon.from_dict(data)
884978
def new_edge(self, node_a, node_b, cost=1):
        """"""
        edge_id = super(UndirectedGraph, self).new_edge(node_a, node_b, cost)
        self.nodes[node_b]['edges'].append(edge_id)
        return edge_id
202406
def get_edge_by_hash(self, edge_hash: str) -> Optional[Edge]:
        """"""
        return self.session.query(Edge).filter(Edge.sha512 == edge_hash).one_or_none()
1229414
def get_graphs_by_ids(self, network_ids: Iterable[int]) -> List[BELGraph]:
        """"""
        rv = [
            self.get_graph_by_id(network_id)
            for network_id in network_ids
        ]
        log.debug('returning graphs for network identifiers: %s', network_ids)
        return rv
1245590
protected void storeOsmWayID(int edgeId, long osmWayId) {
        if (getOsmWayIdSet().contains(osmWayId)) {
            getEdgeIdToOsmWayIdMap().put(edgeId, osmWayId);
        }
    }
805178
def add_edge(self, p_from, p_to, p_id=None):
        
        if not self.has_edge(p_from, p_to):
            if not self.has_node(p_from):
                self.add_node(p_from)

            if not self.has_node(p_to):
                self.add_node(p_to)

            self._edges[p_from].add(p_to)
            self._edge_numbers[(p_from, p_to)] = p_id
285802
def get_dashboard(self, id, **kwargs):
        "
        resp = self._get_object_by_name(self._DASHBOARD_ENDPOINT_SUFFIX, id,
                                        **kwargs)
        return resp
776954
def _add_edge_to_vertex(self, vertex_id, edge):
        
        connected_to = edge.connected_to(vertex_id)
        if vertex_id not in self.vertices:
            vertex_obj = Vertex(vertex_id)
            self.vertices[vertex_id] = vertex_obj
        self.vertices[vertex_id].edges[connected_to] = edge.weight
1207936
def get_endpoint(endpoint_id)
      endpoint = EndPoint.new(@client.make_request(:get, @client.concat_user_path("#{DOMAIN_PATH}/#{id}/endpoints/#{endpoint_id}"))[0],
                           @client)
      endpoint.domain_id = id
      endpoint
    end
938999
public static int getEdgeKey(Graph graph, int edgeId, int node, boolean reverse) {
        EdgeIteratorState edgeIteratorState = graph.getEdgeIteratorState(edgeId, node);
        return GHUtility.createEdgeKey(edgeIteratorState.getBaseNode(), edgeIteratorState.getAdjNode(), edgeId, reverse);
    }
722223
def get_first_edge_id_by_node_ids(self, node_a, node_b):
        """"""
        ret = self.get_edge_ids_by_node_ids(node_a, node_b)
        if not ret:
            return None
        else:
            return ret[0]
1064731
def to_edges(*args)
      selected = args.collect do |arg|
        case arg
          when Integer
            [@edges[arg]]
          when EdgeSet
            arg
          when Array
            arg.collect{|v| to_edges(v)}.flatten.uniq
          when Digraph::Edge
            [arg]
          else
            pred = Predicate.to_predicate(arg)
            edges(pred)
        end
      end.flatten.uniq
      EdgeSet.new(selected)
    end
590142
function _getStopEdges(db, firstId, callback) {

  // Check cache for edges
  let cacheKey = db.id + "-" + firstId;
  let cache = cache_edges.get(cacheKey);
  if ( cache !== null ) {
    return callback(null, cache);
  }

  // Build Select Statement
  let select = "SELECT stop2_id FROM rt_line_graph WHERE stop1_id='" + firstId + "';";

  // Query the database
  db.select(select, function(err, results) {

    // Database Query Error
    if ( err ) {
      return callback(err);
    }

    // List of edges to return
    let rtn = [];

    // Add each connected stop
    for ( let i = 0; i < results.length; i++ ) {
      rtn.push(results[i].stop2_id);
    }

    // Return edges
    cache_edges.put(cacheKey, rtn);
    return callback(null, rtn);

  });

}