code: def test_splits_statistics(
      self,
      num_partitions: int,
      statistics: List[statistics_pb2.DatasetFeatureStatisticsList],
      expected: List[
          Tuple[int, statistics_pb2.DatasetFeatureStatisticsList]
      ],
  ):
      statistics = list(
          text_format.Parse(
              s, statistics_pb2.DatasetFeatureStatisticsList()
          )
          for s in statistics
      )
      expected = list(
          (
              x,
              text_format.Parse(
                  s, statistics_pb2.DatasetFeatureStatisticsList()
              ),
          )
          for x, s in expected
      )
  
      def matcher(
          got: Iterable[
              Tuple[int, statistics_pb2.DatasetFeatureStatisticsList]
          ]
      ):
          self.assertCountEqual(got, expected)
  
      with beam.Pipeline() as p:
          result = (
              p
              | beam.Create(statistics)
              | "KeyAndSplit"
              >> beam.ParDo(
                  feature_partition_util.KeyAndSplitByFeatureFn(
                      num_partitions
                  )
              )
          )
          util.assert_that(result, matcher)
  
imports: from typing import Iterable, List, Tuple
  from unittest import mock
  from absl.testing import absltest
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import pyarrow
  from tensorflow_data_validation.utils import feature_partition_util
  from tensorflow_data_validation.utils import test_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 1 for calling the KeyAndSplitByFeatureFnTest obj's underlying member method code with example usage: obj.test_splits_statistics(num_partitions, statistics, expected) without return types