code: def testSliceEquality(self):
      overall = slicer.SingleSliceSpec()
      age_column = slicer.SingleSliceSpec(columns=["age"])
      age_feature = slicer.SingleSliceSpec(features=[("age", 5)])
      age_and_gender = slicer.SingleSliceSpec(
          columns=["age"], features=[("gender", "f")]
      )
  
      # Note that we construct new instances of the slices to ensure that we
      # aren't just checking object identity.
      def check_equality_and_hash_equality(left, right):
          self.assertEqual(left, right)
          self.assertEqual(hash(left), hash(right))
  
      check_equality_and_hash_equality(
          overall, slicer.SingleSliceSpec()
      )
      check_equality_and_hash_equality(
          age_column, slicer.SingleSliceSpec(columns=["age"])
      )
      check_equality_and_hash_equality(
          age_feature, slicer.SingleSliceSpec(features=[("age", 5)])
      )
      check_equality_and_hash_equality(
          age_and_gender,
          slicer.SingleSliceSpec(
              columns=["age"], features=[("gender", "f")]
          ),
      )
  
      self.assertNotEqual(overall, age_column)
      self.assertNotEqual(age_column, age_feature)
      self.assertNotEqual(age_column, age_and_gender)
      self.assertNotEqual(age_feature, age_and_gender)
  
      self.assertCountEqual([slicer.SingleSliceSpec()], [overall])
      self.assertCountEqual(
          [
              slicer.SingleSliceSpec(columns=["age"]),
              slicer.SingleSliceSpec(),
              slicer.SingleSliceSpec(features=[("age", 5)]),
              slicer.SingleSliceSpec(
                  columns=["age"], features=[("gender", "f")]
              ),
          ],
          [age_and_gender, age_feature, overall, age_column],
      )
  
imports: from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import six
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.extractors import slice_key_extractor
  from tensorflow_model_analysis.post_export_metrics import metric_keys
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from google.protobuf import text_format
label_desc: Use image node_id 6 for calling the SlicerTest obj's underlying member method code with example usage: obj.testSliceEquality() without return types