code: def _percentile_scale(mod, dataset):
      cfg = quantize.current_qconfig()
      chunk_by = cfg.calibrate_chunk_by
      scales = []
      for samples in collect_stats(mod, dataset, chunk_by):
          logging.info(
              "finding threshold with percentile for calibration..."
          )
          with mp.Pool() as pool:
              scales += list(
                  pool.map(_find_scale_by_percentile, samples)
              )
  
      def func(_):
          scale = scales[func.scale_idx]
          func.scale_idx += 1
          return scale
  
      func.scale_idx = 0
  
      return func
  
imports: from __future__ import absolute_import
  import logging
  import multiprocessing
  import numpy
  import tvm
  import tvm.driver
  from tvm.ir import IRModule
  from .None import _quantize
  from .None import quantize
  from ..None import op
  from ..None import expr
  from ..None import analysis
  from ..None import build_module
  from ...contrib import graph_executor
  from .kl_divergence import _find_scale_by_kl
label_desc: Use image node_id 5 for calling a global function with example usage: _percentile_scale(mod, dataset) and returns: func, scale