code: def _quantize(x, bins):
      bins = copy.deepcopy(bins)
      bins = sorted(bins)
      quantized = [bisect.bisect_right(bins, y) for y in x]
      return quantized
  
file_path: transformers/examples/research_projects/distillation/grouped_batch_sampler.py
imports: import bisect
  import copy
  from collections import defaultdict
  import numpy
  from torch.utils.data import BatchSampler, Sampler
  from utils import logger
label_desc: Use image node_id 1 for calling a global function with example usage: _quantize(x, bins) and returns: quantized