code: def write_stats_text(
      stats: statistics_pb2.DatasetFeatureStatisticsList,
      output_path: Text,
  ) -> None:
      """Writes a DatasetFeatureStatisticsList proto to a file in text format.
  
      Args:
        stats: A DatasetFeatureStatisticsList proto.
        output_path: File path to write the DatasetFeatureStatisticsList proto.
  
      Raises:
        TypeError: If the input proto is not of the expected type.
      """
      if not isinstance(
          stats, statistics_pb2.DatasetFeatureStatisticsList
      ):
          raise TypeError(
              "stats is of type %s, should be a "
              "DatasetFeatureStatisticsList proto."
              % type(stats).__name__
          )
  
      stats_proto_text = text_format.MessageToString(stats)
      io_util.write_string_to_file(output_path, stats_proto_text)
  
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 6 for calling a global function with example usage: write_stats_text(stats, output_path) without return types