code: def normalize_ratios(
      ratios: Union[float, Sequence[float]],
      epsilon: float = 1.0e-06,
  ) -> Tuple[float, ...]:
      """Normalize relative sizes.
  
      If the sum is smaller than 1, adds (1 - sum)
  
      :param ratios:
          The ratios.
      :param epsilon:
          A small constant for comparing sum of ratios against 1.
  
      :return:
          A sequence of ratios of at least two elements which sums to one.
  
      :raises ValueError:
          if the ratio sum is bigger than 1.0
      """
      # Prepare split index
      if isinstance(ratios, float):
          ratios = [ratios]
      ratios = tuple(ratios)
      ratio_sum = sum(ratios)
      if ratio_sum < 1.0 - epsilon:
          ratios = ratios + (1.0 - ratio_sum,)
      elif ratio_sum > 1.0 + epsilon:
          raise ValueError(
              f"ratios sum to more than 1.0: {ratios} (sum={ratio_sum})"
          )
      return ratios
  
imports: import logging
  import typing
  from abc import abstractmethod
  from typing import Collection, Optional, Sequence, Set, Tuple, Type, Union
  import numpy
  import pandas
  import torch
  from class_resolver.api import ClassResolver, HintOrType
  from ..constants import COLUMN_LABELS
  from ..typing import LABEL_HEAD, LABEL_RELATION, LABEL_TAIL, MappedTriples, Target, TorchRandomHint
  from ..utils import ensure_torch_random_state
label_desc: Use image node_id 5 for calling a global function with example usage: normalize_ratios(ratios, epsilon) and returns: ratios