should be able to pass in a comparator!
513580
protected static double precision(Set<?> s1, Set<?> s2) {
    double n = 0.0;
    double p = 0.0;
    for (Object o1 : s1) {
      if (s2.contains(o1)) {
        p += 1.0;
      }
      if (DEBUG) {
        if (s2.contains(o1)) {
          System.err.println("Eval Found: "+o1);
        } else {
          System.err.println("Eval Failed to find: "+o1);
        }
      }
      n += 1.0;
    }
    if (DEBUG) System.err.println("Matched " + p + " of " + n);
    return (n > 0.0 ? p / n : 0.0);
  }
1122124
function getComparator(sortOrder) {
  if (typeof sortOrder === 'function') {
    return sortOrder;
  }

  const comparators = {
    [ASC]: ascendingSort,
    [DESC]: descendingSort,
    [ASC_LENGTH]: lengthSort,
    [DESC_LENGTH]: lengthReverseSort
  };

  return comparators[sortOrder];
}
773659
def get_uniform_comparator(comparator):
    
    if comparator in ["eq", "equals", "==", "is"]:
        return "equals"
    elif comparator in ["lt", "less_than"]:
        return "less_than"
    elif comparator in ["le", "less_than_or_equals"]:
        return "less_than_or_equals"
    elif comparator in ["gt", "greater_than"]:
        return "greater_than"
    elif comparator in ["ge", "greater_than_or_equals"]:
        return "greater_than_or_equals"
    elif comparator in ["ne", "not_equals"]:
        return "not_equals"
    elif comparator in ["str_eq", "string_equals"]:
        return "string_equals"
    elif comparator in ["len_eq", "length_equals", "count_eq"]:
        return "length_equals"
    elif comparator in ["len_gt", "count_gt", "length_greater_than", "count_greater_than"]:
        return "length_greater_than"
    elif comparator in ["len_ge", "count_ge", "length_greater_than_or_equals", \
        "count_greater_than_or_equals"]:
        return "length_greater_than_or_equals"
    elif comparator in ["len_lt", "count_lt", "length_less_than", "count_less_than"]:
        return "length_less_than"
    elif comparator in ["len_le", "count_le", "length_less_than_or_equals", \
        "count_less_than_or_equals"]:
        return "length_less_than_or_equals"
    else:
        return comparator
1078151
def _comparator_lt(filter_value, tested_value):
    
    if is_string(filter_value):
        value_type = type(tested_value)
        try:
            # Try a conversion
            filter_value = value_type(filter_value)

        except (TypeError, ValueError):
            if value_type is int:
                # Integer/float comparison trick
                try:
                    filter_value = float(filter_value)
                except (TypeError, ValueError):
                    # None-float value
                    return False
            else:
                # Incompatible type
                return False
    try:
        return tested_value < filter_value
    except TypeError:
        # Incompatible type
        return False
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);
    }
}
766003
def _handle_comparison(self, truism):
        

        # print("COMP:", truism)

        is_lt, is_equal, is_unsigned = self.comparison_info[truism.op]

        size = len(truism.args[0])
        int_max = 2**size-1 if is_unsigned else 2**(size-1)-1
        int_min = -2**(size-1)

        left_min = self._min(truism.args[0], signed=not is_unsigned)
        left_max = self._max(truism.args[0], signed=not is_unsigned)
        right_min = self._min(truism.args[1], signed=not is_unsigned)
        right_max = self._max(truism.args[1], signed=not is_unsigned)

        bound_max = right_max if is_equal else (right_max-1 if is_lt else right_max+1)
        bound_min = right_min if is_equal else (right_min-1 if is_lt else right_min+1)

        if is_lt and bound_max < int_min:
            # if the bound max is negative and we're unsigned less than, we're fucked
            raise ClaripyBalancerUnsatError()
        elif not is_lt and bound_min > int_max:
            # if the bound min is too big, we're fucked
            raise ClaripyBalancerUnsatError()

        current_min = int_min
        current_max = int_max

        if is_lt:
            current_max = min(int_max, left_max, bound_max)
            self._add_upper_bound(truism.args[0], current_max)
        else:
            current_min = max(int_min, left_min, bound_min)
            self._add_lower_bound(truism.args[0], current_min)
393761
static int compare (final Date nextFireTime1,
                        final int priority1,
                        final TriggerKey key1,
                        final Date nextFireTime2,
                        final int priority2,
                        final TriggerKey key2)
    {
      if (nextFireTime1 != null || nextFireTime2 != null)
      {
        if (nextFireTime1 == null)
          return 1;
        if (nextFireTime2 == null)
          return -1;
        if (nextFireTime1.before (nextFireTime2))
          return -1;
        if (nextFireTime1.after (nextFireTime2))
          return 1;
      }

      int comp = priority2 - priority1;
      if (comp == 0)
        comp = key1.compareTo (key2);
      return comp;
    }
671191
@NotNull
    public ComparatorCompat<T> thenComparing(@NotNull final Comparator<? super T> other) {
        return new ComparatorCompat<T>(thenComparing(comparator, other));
    }
253767
public static boolean hasSameComparator(Comparator<?> comparator, Iterable<?> elements) {
    checkNotNull(comparator);
    checkNotNull(elements);
    Comparator<?> comparator2;
    if (elements instanceof SortedSet) {
      comparator2 = comparator((SortedSet<?>) elements);
    } else if (elements instanceof SortedIterable) {
      comparator2 = ((SortedIterable<?>) elements).comparator();
    } else {
      return false;
    }
    return comparator.equals(comparator2);
  }
1346723
function (comparatorArray) {
  return function (a, b) {
    for (var i = 0; i < comparatorArray.length; ++i) {
      var compare = comparatorArray[i](a, b);
      if (compare !== 0)
        return compare;
    }
    return 0;
  };
}
231075
function setComparator() {
    // If the first three letters are "asc", sort in ascending order
    // and remove the prefix.
    if (by.substring(0,3) == 'asc') {
      var i = by.substring(3);
      comp = function(a, b) { return a[i] - b[i]; };
    } else {
      // Otherwise sort in descending order.
      comp = function(a, b) { return b[by] - a[by]; };
    }

    // Reset link styles and format the selected sort option.
    $('a.sel').attr('href', '#').removeClass('sel');
    $('a.by' + by).removeAttr('href').addClass('sel');
  }
899108
def visit_compare(self, node, parent):
        """"""
        newnode = nodes.Compare(node.lineno, node.col_offset, parent)
        newnode.postinit(
            self.visit(node.left, newnode),
            [
                (self._cmp_op_classes[op.__class__], self.visit(expr, newnode))
                for (op, expr) in zip(node.ops, node.comparators)
            ],
        )
        return newnode
108650
function defaultComparer(a, b) {
    if (typeof a === typeof b
        && (typeof a === "number" || typeof a === "string")) {
        return compareNumberOrString(a, b);
    }
    else if (isComparable(a) && isComparable(b)) {
        return b.compareTo(a);
    }
    throw new Error(`cannot compare ${typeof a} with ${typeof b}`);
}
1206374
@NotNull
    public ComparatorCompat<T> thenComparingInt(@NotNull ToIntFunction<? super T> keyExtractor) {
        return thenComparing(comparingInt(keyExtractor));
    }
749739
function( value, comparator ) {
			var error;
			if ( value <= parseFloat( comparator ) ) {
				error = {
					"rule": "greater_than",
					"message": "ERROR:provided value [" + value + "] is not greater than " + parseFloat( comparator )
				};
				return [ error ];
			}
			return;
		}
162630
function _sorter (reader, isDescending, comparer) {
    if (typeof reader !== "function" || reader === identity) {
        reader = null;
    }

    if (typeof comparer !== "function") {
        comparer = _comparer;
    }

    return {
        isDescending: isDescending === true,
        compare: function (a, b) {
            if (reader) {
                a = reader(a);
                b = reader(b);
            }

            return comparer(a, b);
        }
    };
}
180980
public <T> Comparator<T> buildComparator() {
        if (sortedAttributes.isEmpty()) {
            return (o1, o2) -> 0;
        } else {
            Comparator<T> comparator = null;
            for (SortedAttribute sortedAttribute : sortedAttributes) {
                if (comparator == null) {
                    comparator = buildComparator(sortedAttribute);
                } else {
                    comparator = comparator.thenComparing(buildComparator(sortedAttribute));
                }
            }
            return comparator;
        }
    }