code: def goals_slots_helper(
      goals: List[Dict], turnDict: List[Dict]
  ) -> Tuple[Tuple[int, int], Tuple[int, int]]:
      """
      Helper function to see how well the slot keys + slot values match between attempted
      API calls and goals.
  
      Output is precision, recall.
      """
      all_call_slots = {
          k: v for call in turnDict for k, v in call.items()
      }
      all_goal_slots = {k: v for goal in goals for k, v in goal.items()}
      goal_in_call = {
          k: v
          for k, v in all_call_slots.items()
          if all_goal_slots.get(k, "definitelyNotInValuexyz") == v
      }
      call_in_goal = {
          k: v
          for k, v in all_goal_slots.items()
          if all_call_slots.get(k, "definitelyNotInValuexyz") == v
      }
  
      print(goal_in_call, all_call_slots)
  
      return (
          AverageMetric(len(goal_in_call), len(all_call_slots)),
          AverageMetric(len(call_in_goal), len(all_goal_slots)),
      )
  
imports: from parlai.core.message import Message
  from parlai.core.metrics import Metric, AverageMetric, normalize_answer, BleuMetric, SumMetric
  from parlai.core.tod.tod_core import STANDARD_API_NAME_SLOT, STANDARD_REQUIRED_KEY, STANDARD_OPTIONAL_KEY, STANDARD_API_SCHEMAS
  from typing import Dict, List, Optional, Tuple
  from parlai.core.tod.world_metrics_handlers import TodMetricsHandler, register_metrics_handler, _ApiCallGoalInteractionHelper, goals_hit_helper
label_desc: Use image node_id 2 for calling a global function with example usage: goals_slots_helper(goals, turnDict) and returns: AverageMetric,  AverageMetric