def _agent_state_filter(self, check_active, last_heartbeat):
if not check_active:<EOL><INDENT>return True<EOL><DEDENT>return not bc.is_agent_down(last_heartbeat)<EOL>
Filters only active agents, if requested.