code: def _assert_schema_equal(self, lhs, rhs):
      def _assert_features_equal(lhs, rhs):
          lhs_feature_map = {f.name: f for f in lhs.feature}
          rhs_feature_map = {f.name: f for f in rhs.feature}
          self.assertEmpty(set(lhs_feature_map) - set(rhs_feature_map))
          self.assertEmpty(set(rhs_feature_map) - set(lhs_feature_map))
          for feature_name, lhs_feature in lhs_feature_map.items():
              rhs_feature = rhs_feature_map[feature_name]
              if lhs_feature.type != schema_pb2.STRUCT:
                  self.assertEqual(
                      lhs_feature,
                      rhs_feature,
                      "feature: {}\n{}\nvs\n{}".format(
                          feature_name, lhs_feature, rhs_feature
                      ),
                  )
              else:
                  lhs_feature_copy = copy.copy(lhs_feature)
                  rhs_feature_copy = copy.copy(rhs_feature)
                  lhs_feature_copy.ClearField("struct_domain")
                  rhs_feature_copy.ClearField("struct_domain")
                  self.assertEqual(
                      lhs_feature_copy,
                      rhs_feature_copy,
                      "{} \nvs\n {}".format(
                          lhs_feature_copy, rhs_feature_copy
                      ),
                  )
                  _assert_features_equal(
                      lhs_feature.struct_domain,
                      rhs_feature.struct_domain,
                  )
  
      lhs_schema_copy = schema_pb2.Schema()
      lhs_schema_copy.CopyFrom(lhs)
      rhs_schema_copy = schema_pb2.Schema()
      rhs_schema_copy.CopyFrom(rhs)
      lhs_schema_copy.ClearField("feature")
      rhs_schema_copy.ClearField("feature")
      self.assertEqual(lhs_schema_copy, rhs_schema_copy)
      _assert_features_equal(lhs, rhs)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import os
  from absl import flags
  from absl.testing import absltest
  from absl.testing import parameterized
  import apache_beam
  import tensorflow
  import tensorflow_data_validation
  from tensorflow_data_validation.utils import test_util
  from tfx_bsl.tfxio import tf_sequence_example_record
  from google.protobuf import text_format
  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 2 for calling the SequenceExampleStatsTest obj's underlying member method code with example usage: obj._assert_schema_equal(lhs, rhs) without return types