docstr: Returns a new dictionary whose keys are the same as dic's keys. Runs
  over dic's keys, from smallest to largest, and every time that the sum
  of the lengths of the values goes over min_num, it makes the new
  dictionary's values for the associated keys reference a single list
  object whose elements are the with-multiplicity union of the lists that
  appear as values in dic.
  
  Note that in the dictionary that is being output by this function,
  while the keys are the same number of keys as in dic, the number of
  objects in the values can be significantly smaller.
  
  Examples:
  >>> QRX.clump({0.1: [3, 3], 0.3: [0], 1.5: [-8]}, 0)
  {0.1: [3, 3], 0.3: [0], 1.5: [-8]}
  
  >>> QRX.clump({0.1: [3, 3], 0.3: [0], 1.5: [-8]}, 1)
  {0.1: [3, 3], 0.3: [0, -8], 1.5: [0, -8]}
  
  >>> QRX.clump({0.1: [3, 3], 0.3: [0], 1.5: [-8]}, 2)
  {0.1: [3, 3, 0], 0.3: [3, 3, 0], 1.5: [-8]}
  
  Parameters
  ----------
  dic: dict
      float to list
  min_num: int
      minimal number of clump size.
  sorted_keys: list
      sorted(dic.keys()) or None
  
  Returns
  -------
  dict
      float to list; with the values often having the same list object
      appear multiple times
docstr_tok: ["Returns","a","new","dictionary","whose","keys","are","the","same","as","dic","'s","keys",".","Runs","over","dic","'s","keys",",","from","smallest","to","largest",",","and","every","time","that","the","sum","of","the","lengths","of","the","values","goes","over","min_num",",","it","makes","the","new","dictionary","'s","values","for","the","associated","keys","reference","a","single","list","object","whose","elements","are","the","with-multiplicity","union","of","the","lists","that","appear","as","values","in","dic",".","Note","that","in","the","dictionary","that","is","being","output","by","this","function",",","while","the","keys","are","the","same","number","of","keys","as","in","dic",",","the","number","of","objects","in","the","values","can","be","significantly","smaller",".","Examples",":",">",">",">","QRX.clump","(","{","0.1",":","[","3",",","3","]",",","0.3",":","[","0","]",",","1.5",":","[","-8","]","}",",","0",")","{","0.1",":","[","3",",","3","]",",","0.3",":","[","0","]",",","1.5",":","[","-8","]","}",">",">",">","QRX.clump","(","{","0.1",":","[","3",",","3","]",",","0.3",":","[","0","]",",","1.5",":","[","-8","]","}",",","1",")","{","0.1",":","[","3",",","3","]",",","0.3",":","[","0",",","-8","]",",","1.5",":","[","0",",","-8","]","}",">",">",">","QRX.clump","(","{","0.1",":","[","3",",","3","]",",","0.3",":","[","0","]",",","1.5",":","[","-8","]","}",",","2",")","{","0.1",":","[","3",",","3",",","0","]",",","0.3",":","[","3",",","3",",","0","]",",","1.5",":","[","-8","]","}","Parameters","--","--","--","--","--","dic",":","dict","float","to","list","min_num",":","int","minimal","number","of","clump","size",".","sorted_keys",":","list","sorted","(","dic.keys","(",")",")","or","None","Returns","--","--","--","-","dict","float","to","list",";","with","the","values","often","having","the","same","list","object","appear","multiple","times"]
code: def clump(
      dic: Dict, min_num: int, sorted_keys: Optional[List] = None
  ) -> Dict:
      """
      Returns a new dictionary whose keys are the same as dic's keys. Runs
      over dic's keys, from smallest to largest, and every time that the sum
      of the lengths of the values goes over min_num, it makes the new
      dictionary's values for the associated keys reference a single list
      object whose elements are the with-multiplicity union of the lists that
      appear as values in dic.
  
      Note that in the dictionary that is being output by this function,
      while the keys are the same number of keys as in dic, the number of
      objects in the values can be significantly smaller.
  
      Examples:
      >>> QRX.clump({0.1: [3, 3], 0.3: [0], 1.5: [-8]}, 0)
      {0.1: [3, 3], 0.3: [0], 1.5: [-8]}
  
      >>> QRX.clump({0.1: [3, 3], 0.3: [0], 1.5: [-8]}, 1)
      {0.1: [3, 3], 0.3: [0, -8], 1.5: [0, -8]}
  
      >>> QRX.clump({0.1: [3, 3], 0.3: [0], 1.5: [-8]}, 2)
      {0.1: [3, 3, 0], 0.3: [3, 3, 0], 1.5: [-8]}
  
      Parameters
      ----------
      dic: dict
          float to list
      min_num: int
          minimal number of clump size.
      sorted_keys: list
          sorted(dic.keys()) or None
  
      Returns
      -------
      dict
          float to list; with the values often having the same list object
          appear multiple times
      """
      if sorted_keys is None:
          sorted_keys = sorted(dic)
      new_dic = {}
      iter_length = 0
      iter_list = []
      for key in sorted_keys:
          iter_length += len(dic[key])
          iter_list.extend(dic[key])
          new_dic[
              key
          ] = iter_list  # Note that iter_list may change in the
          # future, and this will change the value of new_dic[key]. This
          # is intentional.
          if iter_length >= min_num:
              iter_length = 0
              iter_list = []  # This line, of course, doesn't change any
              # value of new_dic, as it makes iter_list reference a new
              # list object.
      return new_dic
  
imports: from typing import Any, Dict, List, Optional, Union
  import copy
  import numpy
  import pandas
  import xgboost
  import gc
  from collections import defaultdict
  from gluonts.core.component import equals, validated
label_desc: Use image node_id 5 for calling the QRX obj's underlying member method code with example usage: obj.clump(dic, min_num, sorted_keys) and returns: new_dic