Compare with other edge.
971022
@Override
    public int compareTo(Edge other) {
        int cmp = super.compareTo(other);
        if (cmp != 0) {
            return cmp;
        }
        return type - other.type;
    }
800244
def without_edge(self, edge: Edge) -> 'BipartiteGraph[TLeft, TRight, TEdgeValue]':
        """"""
        return BipartiteGraph((e2, v) for e2, v in self._edges.items() if edge != e2)
1050681
def edge_average(a):
    ""

    if len(np.ravel(a)) < 2:
        return float(a[0])
    else:
        top_edge = a[0]
        bottom_edge = a[-1]
        left_edge = a[1:-1,0]
        right_edge = a[1:-1,-1]

        edge_sum = np.sum(top_edge) + np.sum(bottom_edge) + np.sum(left_edge) + np.sum(right_edge)
        num_values = len(top_edge)+len(bottom_edge)+len(left_edge)+len(right_edge)

        return float(edge_sum)/num_values
208734
function getSimilarity(edge, attributes) {
  var total = 0;

  for (var i = 0; i < attributes.length; i++) {
    total += attributes[i](edge);
  }

  return total;
}
1307517
def visit_Compare(self, node):
        """"""

        if len(node.ops) > 1:
            func = Name(id=self._prefix + 'napi_compare', ctx=Load())
            args = [node.left,
                    List(elts=[Str(op.__class__.__name__)
                               for op in node.ops], ctx=Load()),
                    List(elts=node.comparators, ctx=Load())]
            node = Call(func=func, args=args, keywords=self._kwargs)
            fml(node)
        self.generic_visit(node)
        return node
1120824
function comparison(model, options, keys, index=0) {
  const key = keys[index];

  if (keys.length === index) {
    return model[key] === options[key];
  } else if (model[key] === options[key]) {
    return comparison(model, options, keys, index + 1);
  }

  return false;
}
584237
def edge_cost(self, node_a, node_b):
        """"""
        cost = float('inf')
        node_object_a = self.get_node(node_a)
        for edge_id in node_object_a['edges']:
            edge = self.get_edge(edge_id)
            tpl = (node_a, node_b)
            if edge['vertices'] == tpl:
                cost = edge['cost']
                break
        return cost
1102079
@Override
    public int compare(
        ChronoInterval<T> o1,
        ChronoInterval<T> o2
    ) {

        Boundary<T> bs1 = o1.getStart();
        Boundary<T> bs2 = o2.getStart();

        if (bs1.isInfinite()) {
            if (bs2.isInfinite()) {
                return this.compareEnd(o1, o2);
            } else {
                return -1;
            }
        } else if (bs2.isInfinite()) {
            return 1;
        }

        T start1 = bs1.getTemporal();
        T start2 = bs2.getTemporal();

        if (bs1.isOpen()) {
            start1 = this.axis.stepForward(start1);
        }
        if (bs2.isOpen()) {
            start2 = this.axis.stepForward(start2);
        }

        // open max condition (rare edge case)
        if (start1 == null) {
            if (start2 == null) {
                return 0;
            } else {
                return 1;
            }
        } else if (start2 == null) {
            return -1;
        }

        int delta = this.axis.compare(start1, start2);

        if (delta == 0) {
            delta = this.compareEnd(o1, o2);
        }

        return delta;

    }
92612
private EdgeSet<T> addIfAbsent(int v) {
        S edges = getEdgeSet(v);
        if (edges == null) {
            edges = createEdgeSet(v);
            vertexToEdges.put(v, edges);
        }
        return edges;
    }
811556
def vert_opposites_per_edge(self):
        """"""
        result = {}
        for f in self.f:
            for i in range(3):
                key = [f[i], f[(i+1)%3]]
                key.sort()
                key = tuple(key)
                val = f[(i+2)%3]

                if key in result:
                    result[key].append(val)
                else:
                    result[key] = [val]
        return result
1341349
function (node, m, M, compare) {

        node.children.sort(compare);

        var toBBox = this.toBBox,
            leftBBox = distBBox(node, 0, m, toBBox),
            rightBBox = distBBox(node, M - m, M, toBBox),
            margin = bboxMargin(leftBBox) + bboxMargin(rightBBox),
            i, child;

        for (i = m; i < M - m; i++) {
            child = node.children[i];
            extend(leftBBox, node.leaf ? toBBox(child) : child);
            margin += bboxMargin(leftBBox);
        }

        for (i = M - m - 1; i >= m; i--) {
            child = node.children[i];
            extend(rightBBox, node.leaf ? toBBox(child) : child);
            margin += bboxMargin(rightBBox);
        }

        return margin;
    }
1018397
public boolean isMatch(Endpoint other) {
        assert isMarker() : "isMatch can only be used on marker end-points";

        // Same structure as compareTo, except that nulls 'match' IDs (not <)
        int ans = 0;

        // A null edgeLabel implies that all endpoints of that vertex must be
        // matched
        if (edgeLabel == null) {
            return true;
        }

        if (other.getEdgeLabel() == null) {
            // This is not a match because the existing Endpoint no label, but
            // the marker does
            return false;
        }

        ans = edgeLabel.compareTo(other.getEdgeLabel());
        if (ans != 0) {
            return false;
        }

        // A null edgeId implies the 'first' edge for the given vertex for the
        // given edgeLabel
        if (edgeId == null) {
            return true;
        }

        return (edgeId.compareTo(other.getEdgeId()) == 0);
    }
1374512
def Equals(self, other):
    
    return (self._approxEq(self.x, other.x)
            and self._approxEq(self.y, other.y)
            and self._approxEq(self.z, other.z))
1042205
def _adjacency_to_edges(adjacency):
    """"""
    edges = set()
    for u in adjacency:
        for v in adjacency[u]:
            try:
                edge = (u, v) if u <= v else (v, u)
            except TypeError:
                # Py3 does not allow sorting of unlike types
                if (v, u) in edges:
                    continue
                edge = (u, v)

            edges.add(edge)
    return edges
547600
def edge_index(self):
        """"""
        return dict((edge, index) for index, edge in enumerate(self.edges))
916274
function computeEdgeDepths(nodes, orient) {
    var keyAttr = orient === 'vertical' ? 'x' : 'y';
    zrUtil.each(nodes, function (node) {
        node.outEdges.sort(function (a, b) {
            return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];
        });
        node.inEdges.sort(function (a, b) {
            return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];
        });
    });
    zrUtil.each(nodes, function (node) {
        var sy = 0;
        var ty = 0;
        zrUtil.each(node.outEdges, function (edge) {
            edge.setLayout({sy: sy}, true);
            sy += edge.getLayout().dy;
        });
        zrUtil.each(node.inEdges, function (edge) {
            edge.setLayout({ty: ty}, true);
            ty += edge.getLayout().dy;
        });
    });
}
1134558
function compare(other) {
      var bench = this;

      // Exit early if comparing the same benchmark.
      if (bench == other) {
        return 0;
      }
      var critical,
          zStat,
          sample1 = bench.stats.sample,
          sample2 = other.stats.sample,
          size1 = sample1.length,
          size2 = sample2.length,
          maxSize = max(size1, size2),
          minSize = min(size1, size2),
          u1 = getU(sample1, sample2),
          u2 = getU(sample2, sample1),
          u = min(u1, u2);

      function getScore(xA, sampleB) {
        return _.reduce(sampleB, function(total, xB) {
          return total + (xB > xA ? 0 : xB < xA ? 1 : 0.5);
        }, 0);
      }

      function getU(sampleA, sampleB) {
        return _.reduce(sampleA, function(total, xA) {
          return total + getScore(xA, sampleB);
        }, 0);
      }

      function getZ(u) {
        return (u - ((size1 * size2) / 2)) / sqrt((size1 * size2 * (size1 + size2 + 1)) / 12);
      }
      // Reject the null hypothesis the two samples come from the
      // same population (i.e. have the same median) if...
      if (size1 + size2 > 30) {
        // ...the z-stat is greater than 1.96 or less than -1.96
        // http://www.statisticslectures.com/topics/mannwhitneyu/
        zStat = getZ(u);
        return abs(zStat) > 1.96 ? (u == u1 ? 1 : -1) : 0;
      }
      // ...the U value is less than or equal the critical U value.
      critical = maxSize < 5 || minSize < 3 ? 0 : uTable[maxSize][minSize - 3];
      return u <= critical ? (u == u1 ? 1 : -1) : 0;
    }