code: def _compute_ratios(counts, n_total, multilabel=False):
      computed_ratios = {}
      max_count = max(counts.values())
      for class_name, count in counts.items():
          if multilabel:
              ratio = (n_total - count) / count
          else:
              ratio = ratio = max_count / count
          computed_ratios[class_name] = ratio
      return computed_ratios
  
file_path: finetune/finetune/util/imbalance.py
imports: import tensorflow
  import numpy
  from collections import Counter
  from finetune.encoding.target_encoders import LabelEncoder
  from finetune.errors import FinetuneError
label_desc: Use image node_id 2 for calling a global function with example usage: _compute_ratios(counts, n_total, multilabel) and returns: computed_ratios