class_docstr: A decision policy that chooses the action that most of the agents chose.
  This policy is only useful for discrete control.
class_docstr_tok: ["A","decision","policy","that","chooses","the","action","that","most","of","the","agents","chose",".","This","policy","is","only","useful","for","discrete","control","."]
docstr: Given a list of actions from multiple agents, take the action that most agents agree on
  :param actions_info: a list of ActionInfo instances containing the information for each agents action
  :return: a single action
docstr_tok: ["Given","a","list","of","actions","from","multiple","agents",",","take","the","action","that","most","agents","agree","on",":","param","actions_info",":","a","list","of","ActionInfo","instances","containing","the","information","for","each","agents","action",":","return",":","a","single","action"]
code: def choose_action(
      self, actions_info: Dict[str, ActionInfo]
  ) -> ActionInfo:
      """
      Given a list of actions from multiple agents, take the action that most agents agree on
      :param actions_info: a list of ActionInfo instances containing the information for each agents action
      :return: a single action
      """
      # TODO: enforce discrete action spaces
      if len(actions_info.keys()) == 0:
          raise ValueError("The given list of actions is empty")
      vote_count = np.bincount(
          [action_info.action for action_info in actions_info.values()]
      )
      majority_vote = np.argmax(vote_count)
      return actions_info.items()[majority_vote]
  
imports: import copy
  import itertools
  from enum import Enum
  from typing import Union, List, Dict
  import numpy
  from rl_coach.agents.agent_interface import AgentInterface
  from rl_coach.base_parameters import AgentParameters, VisualizationParameters
  from rl_coach.core_types import ActionInfo, EnvResponse, ActionType, RunPhase
  from rl_coach.filters.observation.observation_crop_filter import ObservationCropFilter
  from rl_coach.saver import SaverCollection
  from rl_coach.spaces import ActionSpace
  from rl_coach.spaces import AgentSelection, AttentionActionSpace, SpacesDefinition
  from rl_coach.utils import short_dynamic_import
label_desc: Use image node_id 2 for calling the MajorityVote obj's underlying member method code with example usage: obj.choose_action(actions_info) and returns: actions_info