code: def testBucketizePerKey(
      self, input_data, input_metadata, expected_data, expected_metadata
  ):
      def preprocessing_fn(inputs):
          weights = inputs.get("weights", None)
          x_bucketized = tft.bucketize_per_key(
              inputs["x"],
              inputs["key"],
              num_buckets=3,
              epsilon=0.00001,
              weights=weights,
          )
          return {"x_bucketized": x_bucketized}
  
      self.assertAnalyzeAndTransformResults(
          input_data,
          input_metadata,
          preprocessing_fn,
          expected_data,
          expected_metadata,
      )
  
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 10 for calling the BucketizeIntegrationTest obj's underlying member method code with example usage: obj.testBucketizePerKey(input_data, input_metadata, expected_data, expected_metadata) and returns: dict