code: def testQuantileBucketsWithWeights(self, input_dtype, with_nans):
      def analyzer_fn(inputs):
          return {
              "q_b": tft.quantiles(
                  tf.cast(inputs["x"], input_dtype),
                  num_buckets=3,
                  epsilon=0.00001,
                  weights=inputs["weights"],
              )
          }
  
      input_data = [
          {"x": [x], "weights": [x / 100.0]} for x in range(1, 3000)
      ]
      if with_nans:
          input_data += [
              {"x": [np.nan], "weights": [100000]},
              {"x": [100000], "weights": [np.nan]},
          ]
      input_metadata = tft.DatasetMetadata.from_feature_spec(
          {
              "x": tf.io.FixedLenFeature(
                  [1], tft_unit.canonical_numeric_dtype(input_dtype)
              ),
              "weights": tf.io.FixedLenFeature([1], tf.float32),
          }
      )
      # The expected data has 2 boundaries that divides the data into 3 buckets.
      expected_outputs = {"q_b": np.array([[1732, 2449]], np.float32)}
      self.assertAnalyzerOutputs(
          input_data,
          input_metadata,
          analyzer_fn,
          expected_outputs,
          desired_batch_size=1000,
      )
  
imports: import contextlib
  import random
  import numpy
  import tensorflow
  import tensorflow_transform
  from tensorflow_transform import analyzers
  from tensorflow_transform.beam import impl
  from tensorflow_transform.beam import tft_unit
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 6 for calling the BucketizeIntegrationTest obj's underlying member method code with example usage: obj.testQuantileBucketsWithWeights(input_dtype, with_nans) and returns: dict