code: def _get_default_dataset_statistics(
      statistics: statistics_pb2.DatasetFeatureStatisticsList,
  ) -> statistics_pb2.DatasetFeatureStatistics:
      """Gets the DatasetFeatureStatistics to use for validation.
  
      If there is a single DatasetFeatureStatistics, this function returns that. If
      there are multiple DatasetFeatureStatistics, this function attempts to find
      the one that corresponds to the default slice. If found, this function returns
      that. If not found, this function raises an error.
  
      Args:
        statistics: A DatasetFeatureStatisticsList protocol buffer.
  
      Returns:
        A DatasetFeatureStatistics protocol buffer to use for validation.
  
      Raises:
        ValueError: If the input statistics proto contains multiple datasets, none
            of which corresponds to the default slice.
      """
      if len(statistics.datasets) == 1:
          return statistics.datasets[0]
      # If there are multiple datasets, attempt to find the dataset for the
      # default slice (i.e., slice for all examples) from among the datasets.
      for dataset in statistics.datasets:
          if dataset.name == constants.DEFAULT_SLICE_KEY:
              logging.warning(
                  "Multiple datasets found in statistics. Using the "
                  "default slice dataset."
              )
              return dataset
      # If there are multiple datasets, but the default slice is not found, raise an
      # error.
      raise ValueError(
          "Only statistics proto with one dataset or the default "
          'slice (i.e., "All Examples" slice) is currently supported.'
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  import logging
  from typing import Callable, Iterable, List, Optional, Text, Tuple, Set
  import apache_beam
  import pyarrow
  import tensorflow
  from tensorflow_data_validation import constants
  from tensorflow_data_validation import types
  from tensorflow_data_validation.anomalies.proto import custom_validation_config_pb2
  from tensorflow_data_validation.anomalies.proto import validation_config_pb2
  from tensorflow_data_validation.anomalies.proto import validation_metadata_pb2
  from tensorflow_data_validation.api import validation_options
  from tensorflow_data_validation.pywrap.tensorflow_data_validation_extension import validation
  from tensorflow_data_validation.skew import feature_skew_detector
  from tensorflow_data_validation.skew.protos import feature_skew_results_pb2
  from tensorflow_data_validation.statistics import stats_impl
  from tensorflow_data_validation.statistics import stats_options
  from tensorflow_data_validation.utils import anomalies_util
  from tensorflow_data_validation.utils import slicing_util
  from tensorflow_data_validation.utils import stats_util
  from tensorflow_metadata.proto.v0 import anomalies_pb2
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 12 for calling a global function with example usage: _get_default_dataset_statistics(statistics) and returns: statistics, dataset