def any(sequence, test_func = None):
    """
    Returns 1 if for any member of a sequence, test_func returns a non-zero
    result. If test_func is not supplied, returns 1 if any member of the
    sequence is nonzero (e.g., not one of (), [], None, 0).
    """
    for item in sequence:
        if test_func:
            if test_func(item):
                return 1
        elif item:
            return 1
    return 0