code: def test_get_slice_stats(self):
      statistics = text_format.Parse(
          """
      datasets {
        name: "slice1"
        num_examples: 100
      }
      datasets {
        name: "slice2"
        num_examples: 200
      }
      """,
          statistics_pb2.DatasetFeatureStatisticsList(),
      )
      for slice_key in ["slice1", "slice2"]:
          actual_stats = stats_util.get_slice_stats(
              statistics, slice_key
          )
          self.assertLen(actual_stats.datasets, 1)
          self.assertEqual(actual_stats.datasets[0].name, slice_key)
      with self.assertRaisesRegex(ValueError, "Invalid slice key"):
          stats_util.get_slice_stats(statistics, "slice3")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import flags
  from absl.testing import absltest
  import numpy
  import tensorflow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.utils import artifacts_io_impl
  from tensorflow_data_validation.utils import stats_util
  from google.protobuf import text_format
  from tensorflow.python.util.protobuf import compare
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 14 for calling the StatsUtilTest obj's underlying member method code with example usage: obj.test_get_slice_stats() without return types