code: def _average_type_sum_helper(
      first: AverageType, second: AverageType
  ) -> AverageType:
      """
      Helper to deal with Nones.
  
      We are "clever" in how we aggregate SlotF1Metrics (See SlotMetrics `__init__`) in
      that we add precision and recall values separately, but this means we need to handle
      None.
      """
      if first is None:
          return second
      if second is None:
          return first
      return first + second
  
file_path: ParlAI/parlai/core/tod/teacher_metrics.py
imports: from typing import Optional, List, Dict, Any
  from parlai.core.metrics import AverageMetric, BleuMetric, F1Metric, Metric, Metrics
label_desc: Use image node_id 1 for calling a global function with example usage: _average_type_sum_helper(first, second) and returns: unknown, second, first