code: def test_to_partial_counts_weighted(self):
      t = pa.RecordBatch.from_arrays(
          [
              pa.array([[1], [2], [1]]),
              pa.array([[0.5], [0.5], [2.0]]),
          ],
          ["x", "w"],
      )
      x_path = types.FeaturePath(["x"])
      expected_counts = [
          (
              lift_stats_generator._SlicedXYKey(
                  "", x_path, x=1, y=None
              ),
              2.5,
          ),
          (
              lift_stats_generator._SlicedXYKey(
                  "", x_path, x=2, y=None
              ),
              0.5,
          ),
      ]
      for (expected_key, expected_count), (
          (actual_key, actual_value),
          actual_count,
      ) in zip(
          expected_counts,
          lift_stats_generator._to_partial_counts(
              ("", t),
              path=types.FeaturePath(["x"]),
              boundaries=None,
              weight_column_name="w",
          ),
      ):
          self.assertEqual("", actual_key)
          self.assertEqual(expected_key.x, actual_value)
          self.assertEqual(expected_count, actual_count)
  
imports: from typing import Optional, Sequence, Text
  from absl.testing import absltest
  import apache_beam
  import numpy
  import pandas
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import lift_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 3 for calling the ToPartialCountsTest obj's underlying member method code with example usage: obj.test_to_partial_counts_weighted() without return types