<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _filter_statements(statements, agents):
 """Return INDRA Statements which have Agents in the given list. Only statements are returned in which all appearing Agents as in the agents list. Parameters statements : list[indra.statements.Statement] A list of INDRA Statements to filter. agents : list[str] A list of agent names that need to appear in filtered statements. Returns ------- filtered_statements : list[indra.statements.Statement] The list of filtered INDRA Statements. """

    filtered_statements = []
    for s in stmts:
        if all([a is not None for a in s.agent_list()]) and \
            all([a.name in agents for a in s.agent_list()]):
            filtered_statements.append(s)
    return filtered_statements