code: def _compute_simple_per_key_bucket(val, key, weighted=False):
      if weighted:
          return np.digitize(val, _WEIGHTED_PER_KEY_BUCKETS[key])
      else:
          return np.digitize(val, _SIMPLE_PER_KEY_BUCKETS[key])
  
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 3 for calling a global function with example usage: _compute_simple_per_key_bucket(val, key, weighted) and returns: np, np