nodes: 0, module; 1, function_definition; 2, function_name:gather_votes; 3, parameters; 4, block; 5, identifier:self; 6, identifier:candidates; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Gather votes for the given candidates from the agents in the
          environment.
  
          Returned votes are anonymous, i.e. they cannot be tracked to any
          individual agent afterwards.
  
          :returns:
              A list of votes. Each vote is a list of ``(artifact, preference)``
              -tuples sorted in a preference order of a single agent.
          """; 12, assignment; 13, identifier:a; 14, call; 15, block; 16, identifier:votes; 17, identifier:votes; 18, list; 19, attribute; 20, argument_list; 21, expression_statement; 22, expression_statement; 23, identifier:self; 24, identifier:get_agents; 25, keyword_argument; 26, assignment; 27, call; 28, identifier:addr; 29, False; 30, identifier:vote; 31, call; 32, attribute; 33, argument_list; 34, attribute; 35, argument_list; 36, identifier:votes; 37, identifier:append; 38, identifier:vote; 39, identifier:a; 40, identifier:vote; 41, identifier:candidates
code: def gather_votes(self, candidates):
          """Gather votes for the given candidates from the agents in the
          environment.
  
          Returned votes are anonymous, i.e. they cannot be tracked to any
          individual agent afterwards.
  
          :returns:
              A list of votes. Each vote is a list of ``(artifact, preference)``
              -tuples sorted in a preference order of a single agent.
          """
          votes = []
          for a in self.get_agents(addr=False):
              vote = a.vote(candidates)
              votes.append(vote)
          return votes