code: def _wrap_as_batched_extract(
      extracts: List[types.Extracts],
  ) -> types.Extracts:
      """Wrap list of per-example extracts as a batched extract."""
      result = collections.defaultdict(list)
      for e in extracts:
          for key, value in e.items():
              result[key].append(value)
      return result
  
imports: import collections
  import copy
  from typing import Any, Dict, List, Optional, Sequence
  import apache_beam
  import numpy
  import pyarrow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import constants
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.extractors import legacy_feature_extractor
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
label_desc: Use image node_id 2 for calling a global function with example usage: _wrap_as_batched_extract(extracts) and returns: result