code: def test_single_weighted_feature(
      self,
      batches,
      expected_missing_weight,
      expected_missing_value,
      expected_min_weight_length_diff,
      expected_max_weight_length_diff,
  ):
      schema = text_format.Parse(
          """
          weighted_feature {
            name: 'weighted_feature'
            feature {
              step: 'value'
            }
            weight_feature {
              step: 'weight'
            }
          }
          """,
          schema_pb2.Schema(),
      )
      generator = weighted_feature_stats_generator.WeightedFeatureStatsGenerator(
          schema
      )
  
      expected_stats = statistics_pb2.FeatureNameStatistics()
      expected_stats.path.step.append("weighted_feature")
      expected_stats.custom_stats.add(
          name="missing_weight", num=expected_missing_weight
      )
      expected_stats.custom_stats.add(
          name="missing_value", num=expected_missing_value
      )
      expected_stats.custom_stats.add(
          name="min_weight_length_diff",
          num=expected_min_weight_length_diff,
      )
      expected_stats.custom_stats.add(
          name="max_weight_length_diff",
          num=expected_max_weight_length_diff,
      )
      expected_result = {
          types.FeaturePath(["weighted_feature"]): expected_stats
      }
  
      self.assertCombinerOutputEqual(
          batches, generator, expected_result
      )
  
file_path: data-validation/tensorflow_data_validation/statistics/generators/weighted_feature_stats_generator_test.py
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 pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import weighted_feature_stats_generator
  from tensorflow_data_validation.utils import test_util
  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 1 for calling the WeightedFeatureStatsGeneratorTest obj's underlying member method code with example usage: obj.test_single_weighted_feature(batches, expected_missing_weight, expected_missing_value, expected_min_weight_length_diff, expected_max_weight_length_diff) without return types