convert comparator alias to uniform name
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
340462
def _compare_components(self, other, settings, ratio=False):
        """"""

        first = compare_name_component(
            self.first_list,
            other.first_list,
            settings['first'],
            ratio,
        )

        if settings['check_nickname']:
            if first is False:
                first = compare_name_component(
                    self.nickname_list,
                    other.first_list,
                    settings['first'],
                    ratio
                ) or compare_name_component(
                    self.first_list,
                    other.nickname_list,
                    settings['first'],
                    ratio
                )
            elif ratio and first is not 100:
                first = max(
                    compare_name_component(
                        self.nickname_list,
                        other.first_list,
                        settings['first'],
                        ratio
                    ),
                    compare_name_component(
                        self.first_list,
                        other.nickname_list,
                        settings['first'],
                        ratio
                    ),
                    first,
                )

        middle = compare_name_component(
            self.middle_list,
            other.middle_list,
            settings['middle'],
            ratio,
        )

        last = compare_name_component(
            self.last_list,
            other.last_list,
            settings['last'],
            ratio,
        )

        return first, middle, last
1179908
def comparable(self):
    """"""
    sub_comparable_string = 'identifier: {0:s}'.format(self.identifier)
    return self._GetComparable(sub_comparable_string=sub_comparable_string)
1332587
def alias_list(self, args: argparse.Namespace) -> None:
        """"""
        if args.name:
            for cur_name in utils.remove_duplicates(args.name):
                if cur_name in self.aliases:
                    self.poutput("alias create {} {}".format(cur_name, self.aliases[cur_name]))
                else:
                    self.perror("Alias '{}' not found".format(cur_name), traceback_war=False)
        else:
            sorted_aliases = utils.alphabetical_sort(self.aliases)
            for cur_alias in sorted_aliases:
                self.poutput("alias create {} {}".format(cur_alias, self.aliases[cur_alias]))
837580
private static void replaceInListFilterWithEqualityFilter(List<AbstractExpression> endExprs,
                                                       AbstractExpression inListRhs,
                                                       AbstractExpression equalityRhs)
    {
        for (AbstractExpression comparator : endExprs) {
            AbstractExpression otherExpr = comparator.getRight();
            if (otherExpr == inListRhs) {
                endExprs.remove(comparator);
                AbstractExpression replacement =
                    new ComparisonExpression(ExpressionType.COMPARE_EQUAL,
                                             comparator.getLeft(),
                                             equalityRhs);
                endExprs.add(replacement);
                break;
            }
        }
    }
620356
function comparator(a, b) {
    var aHasIndex = a.hasOwnProperty('index'),
        bHasIndex = b.hasOwnProperty('index');

    if (aHasIndex) {
      if (bHasIndex) {
        if (a.index != b.index) {
          return a.index - b.index;
        }
      }
      else {
        return -1;
      }
    }

    else if (bHasIndex) {
      return 1;
    }

    var aHasTimestamp = a.hasOwnProperty('timestamp'),
        bHasTimestamp = b.hasOwnProperty('timestamp');

    if (aHasTimestamp) {
      if (bHasTimestamp) {
        if (a.timestamp != b.timestamp) {
          return b.timestamp - a.timestamp;
        }
      }
      else {
        return -1;
      }
    }

    else if (bHasTimestamp) {
      return 1;
    }
    
    return a.name > b.name ? 1 : -1;
  }
158897
@Pure
	public BusHub getBusHub(String name, Comparator<String> nameComparator) {
		if (name == null) {
			return null;
		}
		final Comparator<String> cmp = nameComparator == null ? BusNetworkUtilities.NAME_COMPARATOR : nameComparator;
		for (final BusHub busHub : this.validBusHubs) {
			if (cmp.compare(name, busHub.getName()) == 0) {
				return busHub;
			}
		}
		for (final BusHub busHub : this.invalidBusHubs) {
			if (cmp.compare(name, busHub.getName()) == 0) {
				return busHub;
			}
		}
		return null;
	}
1010331
function processAliases(aliases) {
	const result = {
		long: {},
		short: {}
	};

	if (!aliases) {
		return result;
	}

	if (!Array.isArray(aliases)) {
		if (typeof aliases === 'object') {
			if (aliases.long && typeof aliases.long === 'object') {
				Object.assign(result.long, aliases.long);
			}
			if (aliases.short && typeof aliases.short === 'object') {
				Object.assign(result.short, aliases.short);
			}
			return result;
		}

		aliases = [ aliases ];
	}

	for (const alias of aliases) {
		if (!alias || typeof alias !== 'string') {
			throw E.INVALID_ALIAS('Expected aliases to be a string or an array of strings',
				{ name: 'aliases', scope: 'Option.constructor', value: alias });
		}

		for (const a of alias.split(/[ ,|]+/)) {
			const m = a.match(aliasRegExp);
			if (!m) {
				throw E.INVALID_ALIAS(`Invalid alias format "${alias}"`, { name: 'aliases', scope: 'Option.constructor', value: alias });
			}

			if (m[2]) {
				result.short[m[2]] = !m[1];
			} else if (m[3]) {
				result.long[m[3]] = !m[1];
			}
		}
	}

	return result;
}
401000
public static <T> ItemsSketch<T> getInstance(final Comparator<? super T> comparator) {
    return getInstance(PreambleUtil.DEFAULT_K, comparator);
  }
1110820
function variadicComparator(comparator) {
    return function() {
      var result;
      for (var i = 0; i < arguments.length - 1; i++) {
        result = comparator(arguments[i], arguments[i + 1]);
        if (result === false) return result;
      }
      return result; 
    };
  }
1052020
public static void sortBy(MutableFst fst, Comparator<Arc> comparator) {
    int numStates = fst.getStateCount();
    for (int i = 0; i < numStates; i++) {
      MutableState s = fst.getState(i);
      s.arcSort(comparator);
    }
  }
121760
public static ComparatorItem fromSort(Sort sort) {
    if (sort == null) {
      return null;
    }
    ComparatorItem comparatorItem = null;
    for (Order order : sort) {
      ComparatorItem item = fromSortOrder(order);
      if (item != null) {
        if (comparatorItem == null) {
          comparatorItem = item;
        } else {
          comparatorItem.getLastComparatorItem().setNextComparatorItem(item);
        }
      }
    }
    return comparatorItem;
  }
1273953
private boolean distinguishedNameEquals(String dsn1, String dsn2) {
		return new X500Principal(dsn1).equals(new X500Principal(dsn2));
	}
1316605
def compare_name_component(list1, list2, settings, use_ratio=False):
    
    if not list1[0] or not list2[0]:
        not_required = not settings['required']
        return not_required * 100 if use_ratio else not_required

    if len(list1) != len(list2):
        return False

    compare_func = _ratio_compare if use_ratio else _normal_compare
    return compare_func(list1, list2, settings)
202332
def _comparable(self):
        
        return self._replace(
            name='' if self.name is None else self.name,
            wavelength=tuple() if self.wavelength is None else self.wavelength,
            resolution=0 if self.resolution is None else self.resolution,
            polarization='' if self.polarization is None else self.polarization,
            calibration='' if self.calibration is None else self.calibration,
        )
81149
def comparator(self, x, y):
        '''
        

        '''

        indX=0
        indY=0
        for i in range(len(self.stable_names)):
            if self.stable_names[i] == x[0].split('-')[0]:
                indX=i
            if self.stable_names[i] == y[0].split('-')[0]:
                indY=i

        if indX>indY:
            return 1
        if indX==indY:
            return 0
        if indX<indY:
            return -1
180784
def get_prototype(self, alias):
        
        output = sort([
            a.index
            for a in self.get_aliases()
            if re.match(re.escape(alias) + "\\d{8}_\\d{6}", a.index) and not a.alias
        ])
        return output