code: def to_standard_metric_inputs(
      extracts: types.Extracts,
      include_labels: bool = True,
      include_predictions: bool = True,
      include_features: bool = False,
      include_transformed_features: bool = False,
      include_any_feature: bool = False,
      include_attributions: bool = False,
  ) -> metric_types.StandardMetricInputs:
      """Verifies extract keys and converts extracts to StandardMetricInputs."""
      if include_labels and constants.LABELS_KEY not in extracts:
          raise ValueError(
              f'"{constants.LABELS_KEY}" key not found in extracts. '
              "Check that the configuration is setup properly to "
              "specify the name of label input and that the proper "
              "extractor has been configured to extract the labels from "
              f"the inputs. Existing keys: {extracts.keys()}"
          )
      if (
          include_predictions
          and constants.PREDICTIONS_KEY not in extracts
      ):
          raise ValueError(
              f'"{constants.PREDICTIONS_KEY}" key not found in '
              "extracts. Check that the proper extractor has been "
              "configured to perform model inference."
          )
      if include_features and constants.FEATURES_KEY not in extracts:
          raise ValueError(
              f'"{constants.FEATURES_KEY}" key not found in extracts. '
              "Check that the proper extractor has been configured to "
              "extract the features from the inputs. Existing keys: "
              f"{extracts.keys()}"
          )
      if (
          include_transformed_features
          and constants.TRANSFORMED_FEATURES_KEY not in extracts
      ):
          raise ValueError(
              f'"{constants.TRANSFORMED_FEATURES_KEY}" key not found in '
              "extracts. Check that the proper extractor has been "
              "configured to extract the transformed features from the "
              f"inputs. Existing keys: {extracts.keys()}"
          )
      if (
          include_any_feature
          and constants.FEATURES_KEY not in extracts
          and constants.TRANSFORMED_FEATURES_KEY not in extracts
      ):
          raise ValueError(
              f'"{constants.FEATURES_KEY}" or {constants.TRANSFORMED_FEATURES_KEY} '
              "key not found in extracts. Check that the proper extractor has been "
              "configured to extract the attributions from the inputs."
              f"Existing keys: {extracts.keys()}"
          )
      if (
          include_attributions
          and constants.ATTRIBUTIONS_KEY not in extracts
      ):
          raise ValueError(
              f'"{constants.ATTRIBUTIONS_KEY}" key not found in '
              "extracts. Check that the proper extractor has been "
              "configured to extract the attributions from the inputs."
              f"Existing keys: {extracts.keys()}"
          )
      return metric_types.StandardMetricInputs(extracts)
  
imports: import inspect
  import math
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Tuple, Union
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import util
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 14 for calling a global function with example usage: to_standard_metric_inputs(extracts, include_labels, include_predictions, include_features, include_transformed_features, include_any_feature, include_attributions) and returns: metric_types