code: def eval_math_responses(responses, solution=None, **args):
      """Select a response for a math problem using voting, and check if the response is correct if the solution is provided.
  
      Args:
          responses (list): The list of responses.
          solution (str): The canonical solution.
  
      Returns:
          dict: The success metrics.
      """
      n = len(responses)
      if not n:
          return {
              "expected_success": 0,
              "success": False,
              "success_vote": 0,
              "voted_answer": None,
              "votes": 0,
          }
      success_list = []
      if solution is not None:
          for i in range(n):
              response = responses[i]
              succeed = is_equiv_chain_of_thought(response, solution)
              success_list.append(succeed)
      # voting
      answers = voting_counts(responses)
      # find the answer with highest votes in answers
      answer, votes = max(
          answers.items(), key=lambda x: x[1], default=(0, 0)
      )
      # check if the answer is correct
      success_vote = is_equiv_chain_of_thought(
          responses[answer], solution
      )
      return {
          "expected_success": 1 - pow(1 - sum(success_list) / n, n),
          "success": any(s for s in success_list),
          "success_vote": success_vote,
          "voted_answer": responses[answer],
          "votes": votes,
      }
  
file_path: autogen/autogen/math_utils.py
imports: from typing import Optional
  from autogen import oai, DEFAULT_MODEL
label_desc: Use image node_id 13 for calling a global function with example usage: eval_math_responses(responses, solution) and returns: dict, dict