Tells the numerical difference between two ranks.
162340
def difference(cls, first, second):
        """"""

        # so we always get a Rank instance even if string were passed in
        first, second = cls(first), cls(second)
        rank_list = list(cls)
        return abs(rank_list.index(first) - rank_list.index(second))
864275
def highlight_differences(s1, s2, color):
    """"""
    ls1, ls2 = len(s1), len(s2)

    diff_indices = [i for i, (a, b) in enumerate(zip(s1, s2)) if a != b]

    print(s1)

    if ls2 > ls1:
        colorise.cprint('_' * (ls2-ls1), fg=color)
    else:
        print()

    colorise.highlight(s2, indices=diff_indices, fg=color, end='')

    if ls1 > ls2:
        colorise.cprint('_' * (ls1-ls2), fg=color)
    else:
        print()
1242026
def difference_update(self, other, strict=False):
        """"""
        if strict and other not in self:
            raise KeyError(other.difference(self)[0])
        set.difference_update(self, other)
294549
def interval_diff(progression1, progression2, interval):
    """"""
    i = numeral_intervals[numerals.index(progression1)]
    j = numeral_intervals[numerals.index(progression2)]
    acc = 0
    if j < i:
        j += 12
    while j - i > interval:
        acc -= 1
        j -= 1
    while j - i < interval:
        acc += 1
        j += 1
    return acc
153198
private static int med3(int a, int b, int c, IntComparator comp) {
	int ab = comp.compare(a,b);
	int ac = comp.compare(a,c);
	int bc = comp.compare(b,c);
	return (ab<0 ?
		(bc<0 ? b : ac<0 ? c : a) :
		(bc>0 ? b : ac>0 ? c : a));
}
466784
private static int div(int a, int b) {
    return a > 0 ? (b > 0 ? a / b : (a - b - 1) / b)
                 : (b > 0 ? (a - b + 1) / b : a / b);
  }
867401
public int rank () {
		double eps = Math.pow(2.0,-52.0);
		double tol = Math.max(m,n)*s[0]*eps;
		int r = 0;
		for (int i = 0; i < s.length; i++) {
			if (s[i] > tol) {
				r++;
			}
		}
		return r;
	}
1080959
function (a, b) {
      var opts = _.extend({sortOrder: 'asc', sortBy: 'index'}, options);

      a = a.data[opts.sortBy];
      b = b.data[opts.sortBy];

      var result = 0;
      result = a > b ? 1 : a < b ? -1 : 0;
      if(opts.sortOrder.toLowerCase() === 'desc') {
        return result * -1;
      }
      return result;
    }
15466
function defaultComparator(a, b) {
    if (a == b) {
        return 0;
    } else if (a > b) {
        return 1;
    } else if (a < b) {
        return -1;
    } else {
        throw new Error("Unstable comparison: " + a + " compared to " + b);
    }
}
213899
def ranks(self, key, value):
    """"""
    return [normalize_rank(el) for el in force_list(value.get('a'))]
1136286
def glb(self, other):
        
        return self.__class__(
            [
                min(self.lower, other.lower),
                min(self.upper, other.upper)
            ],
            lower_inc=self.lower_inc if self < other else other.lower_inc,
            upper_inc=self.upper_inc if self > other else other.upper_inc,
        )
405580
public int countDifferencesBetweenAnd(String first, String second) {
        if (first == null) {
            if (second == null) {
                return 0;
            } else {
                first = "";
            }
        } else if (second == null) {
            second = "";
        }
        LinkedList<DiffMatchPatch.Diff> diffs = getDiffs(first, second);
        int diffCount = 0;
        for (DiffMatchPatch.Diff diff : diffs) {
            if (diff.operation != DiffMatchPatch.Operation.EQUAL) {
                diffCount++;
            }
        }
        return diffCount;
    }
1028103
function(a, b) {
          let aVal = a[sortField];
          let bVal = b[sortField];
          return (!aVal && bVal) || (aVal < bVal) ? -1 : (aVal && !bVal) || (aVal > bVal) ? 1 : 0;
        }
861930
def value_eq(self, other):
        """"""
        self_sorted = ordered.ordered(self.getvalues())
        other_sorted = ordered.ordered(repeated.getvalues(other))
        return self_sorted == other_sorted
836161
private static int compareInt(final int a, final int b) {
		int result = 0;
		if (a > b) {
			result = 1;
		} else if (a < b) {
			result = -1;
		}
		return result;
	}
205140
def level_is_between(level, min_level_value, max_level_value):
    """"""
    level_value = get_level_value(level)
    if level_value is None:
        # unknown level value
        return False
    return level_value >= min_level_value and level_value <= max_level_value
1218958
private void diffClique(float[] weights, int p) {
		for (int t = 0; t < orders.length; t++) {
			if (data[p][t] == -1)
				continue;

			if (orders[t] == 0) {
				if (golds[p] != preds[p]) {
					int ts = data[p][t] + golds[p];
					int ps = data[p][t] + preds[p];
					adjust(weights, ts, ps);
				}
			}
			if (p > 0 && orders[t] == 1) {
				int ts = data[p][t] + (golds[p - 1] * ysize + golds[p]);
				int ps = data[p][t] + (preds[p - 1] * ysize + preds[p]);
				adjust(weights, ts, ps);
			}
		}
	}