def filter_frontier(frontier, pred_fns, cfg_pred_fns=None):
    """Filter out points from the frontier that don't pass all the pred_fns.
    If a pred_fn is None, ignore that metric.
    """
    new_frontier = []
    for result in frontier:
        cfg, qos = result
        keep = True
        if not all(f(x) for x, f in zip(qos, pred_fns) if f is not None):
            keep = False
        if cfg_pred_fns is not None:
            if not all(f(x) for x, f in zip(cfg, cfg_pred_fns) if f is not None):
                keep = False
        if keep:
            new_frontier.append(result)
    return new_frontier