code: def round_preserving_sum(iterable) -> np.ndarray:
      """Rounds an iterable of floats while retaining the original summed value.
      The name of each parameter is required. The type and description of each
      parameter is optional, but should be included if not obvious.
  
      The while loop in this code was adapted from:
      https://github.com/cgdeboer/iteround
  
      Parameters
      -----------
      iterable : list<float> or np.ndarray<float>
          An iterable of floats
  
      Returns
      -------
      list<int> or np.ndarray<int>
          The iterable rounded to int, preserving sum."""
  
      floats = np.asarray(iterable, dtype=float)
      ints = floats.round()
      orig_sum = np.sum(floats).round()
      int_sum = np.sum(ints).round()
      # Adjust the integers so that they sum to orig_sum
      while abs(int_sum - orig_sum) > FLOATING_POINT_COMPARISON:
          diff = np.round(orig_sum - int_sum)
          increment = -1 if int(diff < 0.0) else 1
          changes = min(int(abs(diff)), len(iterable))
          # Orders indices by difference. Increments # of changes.
          indices = np.argsort(floats - ints)[::-increment][:changes]
          for i in indices:
              ints[i] = ints[i] + increment
          int_sum = np.sum(ints).round()
      return ints.astype(int)
  
imports: import warnings
  import numpy
  import pandas
  from typing import Union, Tuple
  from cleanlab.typing import DatasetLike, LabelLike
  from cleanlab.internal.validation import labels_to_array
  from cleanlab.internal.constants import FLOATING_POINT_COMPARISON, TINY_VALUE
label_desc: Use image node_id 7 for calling a global function with example usage: round_preserving_sum(iterable) and returns: ints