def register_comparator(comparator_name, comparator_function):
    """ Register a new twpo-argument comparator function returning true or false """
    if not isinstance(comparator_name, basestring):
        raise TypeError("Cannot register a non-string comparator name")
    elif comparator_name in COMPARATORS:
        raise ValueError(
            "Cannot register a comparator name that already exists: {0}".format(comparator_name))
    COMPARATORS[comparator_name] = comparator_function

# --- REGISTRY OF EXTRACTORS AND VALIDATORS ---
dataset/ETHPy150Open svanoort/pyresttest/pyresttest/validators.py/register_comparator/original