code: def round_list(l: List[float], max_sum: int):
      r"""round a list of float e.g. [0.2,1.5, 4.5]
      to [1,2,4] # ceil and restrict the sum to `max_sum`
      used into balanced truncate.
      """
      s = 0
      for idx, i in enumerate(l):
          i = ceil(i)
          if s <= max_sum:
              s += i
              if s <= max_sum:
                  l[idx] = i
              else:
                  l[idx] = i - (s - max_sum)
          else:
              l[idx] = int(0)
      assert sum(l) == max_sum
  
file_path: OpenPrompt/openprompt/utils/utils.py
imports: from math import ceil
  import os
  import shutil
  from typing import List
  import inspect
  from collections import namedtuple
  import torch
  from yacs.config import CfgNode
  from openprompt.utils.logging import logger
label_desc: Use image node_id 1 for calling a global function with example usage: round_list(l, max_sum) without return types