code: def _lprobe(weights, num_parts, bottleneck):
      num_items = len(weights)
      total_weight = weights[-1]
  
      # initialize partitioning
      parts = [0] * (num_parts + 1)
      for p in range(1, num_parts + 1):
          parts[p] = num_items
  
      bsum = (
          bottleneck  # running sum of target weight for pth partition
      )
      chunksize = num_items // num_parts
      step = chunksize
      for p in range(1, num_parts):
          # Jump to the next bucket
          while (step < num_items) and (weights[step] < bsum):
              step += chunksize
  
          # Find the end index of partition p
          parts[p] = bisect_left(
              weights,
              bsum,
              lo=step - chunksize,
              hi=min(step, num_items),
          )
          # Nothing more to partition, return early
          if parts[p] == num_items:
              # See if the current partition is overweight.
              part_size = weights[-1] - weights[parts[p - 1]]
              return parts, part_size < bottleneck
  
          # Next partition target
          bsum = weights[parts[p] - 1] + bottleneck
  
      return parts, bsum >= total_weight
  
imports: from collections.abc import Iterable
  from deepspeed.moe.utils import is_moe_param
  import os
  import psutil
  import gc
  from math import sqrt
  from math import floor
  from bisect import bisect_left
  import torch
  from torch import inf
  from deepspeed import comm
  from deepspeed.utils import groups, logger
  from deepspeed.runtime.constants import PIPE_REPLICATED
  from numpy import prod
label_desc: Use image node_id 16 for calling a global function with example usage: _lprobe(weights, num_parts, bottleneck) and returns: parts,  unknown, parts,  unknown