<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_agents_with_name(name, stmts):
 """Return all agents within a list of statements with a particular name."""

    return [ag for stmt in stmts for ag in stmt.agent_list()
            if ag is not None and ag.name == name]