code: def test_batch_examples(self):
      examples = [
          {
              "a": np.array([1.0, 2.0], dtype=np.float32),
              "b": np.array(["a", "b", "c", "e"]),
          },
          {
              "a": np.array([3.0, 4.0, 5.0], dtype=np.float32),
          },
          {
              "b": np.array(["d", "e", "f"]),
              "d": np.array([10, 20, 30], dtype=np.int64),
          },
          {"b": np.array(["a", "b", "c"])},
          {"c": np.array(["d", "e", "f"])},
      ]
      expected_record_batches = [
          pa.RecordBatch.from_arrays(
              [
                  pa.array(
                      [[1.0, 2.0], [3.0, 4.0, 5.0]],
                      type=pa.list_(pa.float32()),
                  ),
                  pa.array([["a", "b", "c", "e"], None]),
              ],
              ["a", "b"],
          ),
          pa.RecordBatch.from_arrays(
              [
                  pa.array([["d", "e", "f"], ["a", "b", "c"]]),
                  pa.array(
                      [[10, 20, 30], None], type=pa.list_(pa.int64())
                  ),
              ],
              ["b", "d"],
          ),
          pa.RecordBatch.from_arrays(
              [pa.array([["d", "e", "f"]])], ["c"]
          ),
      ]
  
      with beam.Pipeline() as p:
          result = (
              p
              | beam.Create(examples, reshuffle=False)
              | batch_util.BatchExamplesToArrowRecordBatches(
                  desired_batch_size=2
              )
          )
          util.assert_that(
              result,
              test_util.make_arrow_record_batches_equal_fn(
                  self, expected_record_batches
              ),
          )
  
file_path: data-validation/tensorflow_data_validation/utils/batch_util_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import pyarrow
  from tensorflow_data_validation.utils import batch_util
  from tensorflow_data_validation.utils import test_util
label_desc: Use image node_id 1 for calling the BatchUtilTest obj's underlying member method code with example usage: obj.test_batch_examples() without return types