def get_agent_by_id(agents, agent_id):
    """
    Finds an agent in a list of agents, by id
    :param agents: the list to look into
    :param agent_id: the id to look for
    :return: the agent (if found)
    """
    for agent in agents:
        if agent["id"] == agent_id:
            return agent
    raise ValueError("Agent of id {0} is not in agent_information".format(agent_id))