code: def calculate_scores_form_response(
      response: str, evaluation: Dict[str, Any]
  ) -> int:
      """
      Calculate the score from the response returned by gpt-3.5-turbo or gpt-4.
      Different from text-davinci-003, this fuction directly calculates the score according to the plain response returned by gpt-3.5-turbo or gpt-4.
      Although text-davinci-003 can return log probabilities, it costs ten times as much as gpt-3.5-turbo.
  
      Args:
          response: logprobs returned by openai.Completion.
          evaluation: the evaluation corresponds to the question.
  
      Returns:
          The score of one answer.
      """
  
      try:
          results = re.findall(r"\d", response)
          if len(results) == 1:
              return int(results[0])
          else:
              raise Exception(f"Invalid score pair. Got {evaluation}.")
      except Exception:
          return 0
  
imports: import concurrent.futures
  import os
  import re
  import time
  from copy import deepcopy
  from typing import Any, Dict, List
  import matplotlib.pyplot
  import numpy
  import openai
  import pandas
  import seaborn
  import tqdm
  from colossal_eval.utils import jdump, jload
label_desc: Use image node_id 12 for calling a global function with example usage: calculate_scores_form_response(response, evaluation) and returns: int, int