class_docstr: Tests SamplePartition.
docstr: This matches partitions for equality.
  
  A partition is Tuple(int, record_batch).
  
  Args:
    expected: Tuple(int, record_batch). The expected partition.
  
  Returns:
    A callable that can be used with `beam_test_util.assert_that`.
docstr_tok: ["This","matches","partitions","for","equality",".","A","partition","is","Tuple","(","int",",","record_batch",")",".","Args",":","expected",":","Tuple","(","int",",","record_batch",")",".","The","expected","partition",".","Returns",":","A","callable","that","can","be","used","with","`","beam_test_util.assert_that","`","."]
code: def _partition_matcher(self, expected):
      """This matches partitions for equality.
  
      A partition is Tuple(int, record_batch).
  
      Args:
        expected: Tuple(int, record_batch). The expected partition.
  
      Returns:
        A callable that can be used with `beam_test_util.assert_that`.
      """
  
      def _matcher(actual):
          for expected_tuple, actual_tuple in zip(expected, actual):
              self.assertEqual(expected_tuple[0], actual_tuple[0])
              expected_rb = expected_tuple[1]
              actual_rb = actual_tuple[1]
              self.assertIsInstance(expected_rb, pa.RecordBatch)
              self.assertTrue(
                  actual_rb.equals(expected_rb),
                  f"Record Batches not equal. "
                  f"actual: {actual_rb.to_pydict()}\nexpected: {expected_rb.to_pydict()}",
              )
  
      return _matcher
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import pyarrow
  from tensorflow_data_validation import constants
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import partitioned_stats_generator
  from tensorflow_data_validation.statistics.generators import sklearn_mutual_information
  from tensorflow_data_validation.utils import test_util
  from google.protobuf import text_format
  from tensorflow.python.util.protobuf import compare
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 1 for calling the SampleRecordBatchRows obj's underlying member method code with example usage: obj._partition_matcher(expected) and returns: _matcher