code: def _balance_sizes_downsizing(
      dist1_counts, dist2_counts, round_to_int: bool = True
  ):
      """Balance the sizes of the distributions by multiplying the larger one by a constant."""
      dist1_sum, dist2_sum = sum(dist1_counts), sum(dist2_counts)
      if dist1_sum > dist2_sum:
          dist1_counts = dist1_counts * (dist2_sum / dist1_sum)
      elif dist1_sum < dist2_sum:
          dist2_counts = dist2_counts * (dist1_sum / dist2_sum)
  
      if round_to_int is True:
          dist1_counts, dist2_counts = np.round(dist1_counts), np.round(
              dist2_counts
          )
      return dist1_counts, dist2_counts
  
imports: from numbers import Number
  from typing import Dict, Optional, Tuple, Union
  import numpy
  import pandas
  from plotly.graph_objs import Figure
  from plotly.subplots import make_subplots
  from scipy.stats import chi2_contingency, wasserstein_distance
  from deepchecks.core import ConditionCategory, ConditionResult
  from deepchecks.core.errors import DeepchecksValueError, NotEnoughSamplesError
  from deepchecks.utils.dict_funcs import get_dict_entry_by_value
  from deepchecks.utils.distribution.plot import CategoriesSortingKind, drift_score_bar_traces, feature_distribution_traces
  from deepchecks.utils.distribution.preprocessing import preprocess_2_cat_cols_to_same_bins
  from deepchecks.utils.plot import DEFAULT_DATASET_NAMES
  from deepchecks.utils.strings import format_number
label_desc: Use image node_id 5 for calling a global function with example usage: _balance_sizes_downsizing(dist1_counts, dist2_counts, round_to_int) and returns: dist1_counts,  dist2_counts