def register_validator(name, parse_function):
    ''' Registers a validator for use by this library
        Name is the string name for validator

        Parse function does parse(config_node) and returns a Validator object
        Validator functions have signature:
            validate(response_body, context=None) - context is a bindings.Context object

        Validators return true or false and optionally can return a Failure instead of false
        This allows for passing more details
    '''
    name = name.lower()
    if VALIDATORS in name:
        raise Exception("Validator exists with this name: {0}".format(name))

    VALIDATORS[name] = parse_function
dataset/ETHPy150Open svanoort/pyresttest/pyresttest/validators.py/register_validator/swapped operands of `in`