def _safe_filter_fun(filter_function, d, i):
    """Helper function that returns False if an exception occurs instead of stopping the loop."""
    try:
        return filter_function(d, i)
    except:
        return False