code: def write_anomalies_text(
      anomalies: anomalies_pb2.Anomalies, output_path: Text
  ) -> None:
      """Writes the Anomalies proto to a file in text format.
  
      Args:
        anomalies: An Anomalies protocol buffer.
        output_path: File path to which to write the Anomalies proto.
  
      Raises:
        TypeError: If the input Anomalies proto is not of the expected type.
      """
      if not isinstance(anomalies, anomalies_pb2.Anomalies):
          raise TypeError(
              "anomalies is of type %s; should be an Anomalies proto."
              % type(anomalies).__name__
          )
  
      anomalies_text = text_format.MessageToString(anomalies)
      io_util.write_string_to_file(output_path, anomalies_text)
  
file_path: data-validation/tensorflow_data_validation/utils/anomalies_util.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Iterable, FrozenSet, List, Text, Tuple
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.utils import io_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import anomalies_pb2
label_desc: Use image node_id 4 for calling a global function with example usage: write_anomalies_text(anomalies, output_path) without return types