code: def load_statistics(
      input_path: Text,
  ) -> statistics_pb2.DatasetFeatureStatisticsList:
      """Loads data statistics proto from file.
  
      Args:
        input_path: Data statistics file path. The file should be a one-record
          TFRecord file or a plain file containing the statistics proto in Proto
          Text Format.
  
      Returns:
        A DatasetFeatureStatisticsList proto.
  
      Raises:
        IOError: If the input path does not exist.
      """
      if not tf.io.gfile.exists(input_path):
          raise IOError("Invalid input path {}.".format(input_path))
      try:
          return load_stats_tfrecord(input_path)
      except Exception:  # pylint: disable=broad-except
          logging.info(
              "File %s did not look like a TFRecord. Try reading as a plain "
              "file.",
              input_path,
          )
          return load_stats_text(input_path)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  from typing import Dict, Iterable, Optional, Sequence, Text, Tuple, Union
  import numpy
  import pyarrow
  import tensorflow
  from tensorflow_data_validation import constants
  from tensorflow_data_validation import types
  from tensorflow_data_validation.arrow import arrow_util
  from tensorflow_data_validation.utils import artifacts_io_impl
  from tensorflow_data_validation.utils import io_util
  from tfx_bsl import statistics
  from tfx_bsl.arrow import array_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 13 for calling a global function with example usage: load_statistics(input_path) and returns: load_stats_tfrecord, load_stats_text