def grounding_filter(stmts):
    """Filter a set of statements to include only those with grounded entities.

    If a statement contains only agents having a non-empty `db_refs` dict,
    it is included in the result

    Parameters
    ----------
    stmts : list of :py:class:`indra.statements.Statement`
        Statements to filter.

    Returns
    -------
    list of :py:class:`indra.statements.Statement`
        Statements after filtering.
    """
    grounded_stmts = []
    for stmt in stmts:
        agents = [a for a in stmt.agent_list() if a is not None]
        if all(a.db_refs for a in agents):
            grounded_stmts.append(stmt)
    return grounded_stmts