code: def testWriteAnomalies(self):
      anomalies = text_format.Parse(
          """anomaly_info {
                 key: "feature_1"
                 value {
                    description: "Some description"
                    severity: ERROR
                    short_description: "Description"
                    reason {
                      type: ENUM_TYPE_UNEXPECTED_STRING_VALUES
                      short_description: "Unexpected string values"
                      description: "Examples contain values missing"
                    }
                  }
                }""",
          anomalies_pb2.Anomalies(),
      )
      binary_proto_filepath = os.path.join(
          FLAGS.test_tmpdir, "SchemaDiff.pb"
      )
      writer_utils.write_anomalies(binary_proto_filepath, anomalies)
      # Check binary proto file.
      read_binary_anomalies = anomalies_pb2.Anomalies()
      read_binary_anomalies.ParseFromString(
          io_utils.read_bytes_file(binary_proto_filepath)
      )
      self.assertProtoEquals(read_binary_anomalies, anomalies)
  
file_path: tfx/tfx/utils/writer_utils_test.py
imports: import os
  from absl import flags
  import tensorflow
  from tfx.utils import io_utils
  from tfx.utils import writer_utils
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import anomalies_pb2
label_desc: Use image node_id 1 for calling the WriterUtilsTest obj's underlying member method code with example usage: obj.testWriteAnomalies() without return types