code: def _ParseExample(
      extracts: types.Extracts, materialize_columns: bool = True
  ) -> None:
      """Feature extraction from serialized tf.Example."""
      # Deserialize the example.
      example = tf.train.Example()
      try:
          example.ParseFromString(extracts[constants.INPUT_KEY])
      except:  # pylint: disable=bare-except
          logging.warning(
              "Could not parse tf.Example from the input source."
          )
  
      features = {}
      if constants.FEATURES_PREDICTIONS_LABELS_KEY in extracts:
          features = extracts[
              constants.FEATURES_PREDICTIONS_LABELS_KEY
          ].features
  
      for name in example.features.feature:
          if materialize_columns or name not in features:
              key = util.compound_key(["features", name])
              value = example.features.feature[name]
              if value.HasField("bytes_list"):
                  values = list(v for v in value.bytes_list.value)
              elif value.HasField("float_list"):
                  values = list(v for v in value.float_list.value)
              elif value.HasField("int64_list"):
                  values = list(v for v in value.int64_list.value)
              if materialize_columns:
                  extracts[key] = types.MaterializedColumn(
                      name=key, value=values
                  )
              if name not in features:
                  features[name] = {
                      encoding.NODE_SUFFIX: np.array([values])
                  }
  
file_path: model-analysis/tensorflow_model_analysis/extractors/legacy_feature_extractor.py
imports: import copy
  from typing import Any, Dict, List, Optional
  from absl import logging
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 3 for calling a global function with example usage: _ParseExample(extracts, materialize_columns) without return types