code: def parse_test_cases(test_cases, feature_names, input_types):
      """
      Parses test cases to be used in gradio Dataframe. Note that an apostrophe is added
      to strings to follow the format in json.
      """
      if len(test_cases) == 0:
          return None
      examples = []
      for test_case in test_cases:
          parsed_cases = []
          for feat, input_type in zip(feature_names, input_types):
              if input_type == "json":
                  parsed_cases.append(
                      [str(element) for element in test_case[feat]]
                  )
              elif input_type == "str":
                  parsed_cases.append(
                      [
                          '"' + element + '"'
                          for element in test_case[feat]
                      ]
                  )
              else:
                  parsed_cases.append(test_case[feat])
          examples.append([list(i) for i in zip(*parsed_cases)])
      return examples
  
file_path: evaluate/src/evaluate/utils/gradio.py
imports: import json
  import os
  import re
  import sys
  from pathlib import Path
  import numpy
  from datasets import Value
  from .logging import get_logger
label_desc: Use image node_id 5 for calling a global function with example usage: parse_test_cases(test_cases, feature_names, input_types) and returns: examples, None