def filter_filings(seq, form=None, period=None):
    """Generate a list of filings in `seq` that match the criteria."""

    if form is not None:
        seq = (f for f in seq if f.region == form.region
                             and f.name == form.name)

    if period is not None:
        seq = (f for f in seq if f.period_name == period.name)

    return seq