def METHOD_NAME(lf, rf):
  """Creates a filter that keeps the union of two filters.
  Args:
    lf: first filter
    rf: second filter
  Returns:
    A filter function that keeps the n largest paths.
  """
  def keep(paths):
    l = set(lf(paths))
    r = set(rf(paths))
    return sorted(list(l|r))
  return keep