code: def test_two_feature_partitions(self):
      # Note: default partitioner assigns a->1, b->0
      b1 = pa.RecordBatch.from_arrays(
          [
              pa.array([[1.0, 2.0], [3.0, 4.0, 5.0]]),
              pa.array([["abc"], ["xyz"]]),
          ],
          ["a", "b"],
      )
      batches = [b1]
      expected_result = {
          types.FeaturePath(["b"]): text_format.Parse(
              """
              type: STRING
              string_stats {
                common_stats {
                  num_non_missing: 2
                  min_num_values: 1
                  max_num_values: 1
                  avg_num_values: 1.0
                  num_values_histogram {
                    buckets {
                      low_value: 1.0
                      high_value: 1.0
                      sample_count: 0.5
                    }
                    buckets {
                      low_value: 1.0
                      high_value: 1.0
                      sample_count: 0.5
                    }
                    buckets {
                      low_value: 1.0
                      high_value: 1.0
                      sample_count: 0.5
                    }
                    buckets {
                      low_value: 1.0
                      high_value: 1.0
                      sample_count: 0.5
                    }
                    type: QUANTILES
                  }
                  tot_num_values: 2
                }
                avg_length: 3.0
              }
              path {
                step: "b"
              }
              """,
              statistics_pb2.FeatureNameStatistics(),
          )
      }
      generator = basic_stats_generator.BasicStatsGenerator(
          num_values_histogram_buckets=4,
          num_histogram_buckets=3,
          num_quantiles_histogram_buckets=4,
      )
      # Note: partition 0 contains feature "b"
      generator = generator._copy_for_partition_index(0, 2)
      self.assertCombinerOutputEqual(
          batches, generator, expected_result
      )
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import basic_stats_generator
  from tensorflow_data_validation.utils import test_util
  from tensorflow_data_validation.utils.example_weight_map import ExampleWeightMap
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 2 for calling the BasicStatsGeneratorTest obj's underlying member method code with example usage: obj.test_two_feature_partitions() without return types