def iter_in(value, seq, cmp):
    """
    A function behaving like the "in" Python operator, but which works with a
    a comparator function.  This function checks whether the given value is
    contained in the given iterable.

    Args:
        value: A value
        seq: An iterable
        cmp: A 2-arg comparator function which must return 0 if the args
            are equal

    Returns:
        True if the value is found in the iterable, False if it is not
    """
    result = False
    for seq_val in seq:
        if cmp(value, seq_val) == 0:
            result = True
            break

    return result