nodes: 0, module; 1, function_definition; 2, function_name:vote; 3, parameters; 4, block; 5, identifier:self; 6, identifier:candidates; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, comment:"""Rank artifact candidates.
  
          The voting is needed for the agents living in societies using
          social decision making. The function should return a sorted list
          of (candidate, evaluation)-tuples. Depending on the social choice
          function used, the evaluation might be omitted from the actual decision
          making, or only a number of (the highest ranking) candidates may be
          used.
  
          This basic implementation ranks candidates based on
          :meth:`~creamas.core.agent.CreativeAgent.evaluate`.
  
          :param candidates:
              list of :py:class:`~creamas.core.artifact.Artifact` objects to be
              ranked
  
          :returns:
              Ordered list of (candidate, evaluation)-tuples
          """; 12, assignment; 13, call; 14, identifier:ranks; 15, identifier:ranks; 16, list_comprehension; 17, attribute; 18, argument_list; 19, tuple; 20, for_in_clause; 21, identifier:ranks; 22, identifier:sort; 23, keyword_argument; 24, keyword_argument; 25, identifier:c; 26, subscript; 27, identifier:c; 28, identifier:candidates; 29, identifier:key; 30, call; 31, identifier:reverse; 32, True; 33, call; 34, integer:0; 35, attribute; 36, argument_list; 37, attribute; 38, argument_list; 39, identifier:operator; 40, identifier:itemgetter; 41, integer:1; 42, identifier:self; 43, identifier:evaluate; 44, identifier:c
code: def vote(self, candidates):
          """Rank artifact candidates.
  
          The voting is needed for the agents living in societies using
          social decision making. The function should return a sorted list
          of (candidate, evaluation)-tuples. Depending on the social choice
          function used, the evaluation might be omitted from the actual decision
          making, or only a number of (the highest ranking) candidates may be
          used.
  
          This basic implementation ranks candidates based on
          :meth:`~creamas.core.agent.CreativeAgent.evaluate`.
  
          :param candidates:
              list of :py:class:`~creamas.core.artifact.Artifact` objects to be
              ranked
  
          :returns:
              Ordered list of (candidate, evaluation)-tuples
          """
          ranks = [(c, self.evaluate(c)[0]) for c in candidates]
          ranks.sort(key=operator.itemgetter(1), reverse=True)
          return ranks