code: def normalize_pred_probas(y_predprob, problem_type, eps=1e-7):
      """Remaps the predicted probabilities to ensure there are no zeros (needed for certain metrics like log-loss)
      and that no predicted probability exceeds [0,1] (eg. in distillation when classification is treated as regression).
      Args:
          y_predprob: 1D (for binary classification) or 2D (for multiclass) numpy array of predicted probabilities
          problem_type: We only consider normalization if the problem_type is one of: [BINARY, MULTICLASS, SOFTCLASS]
          eps: controls around how far from 0 remapped predicted probabilities should be (larger `eps` means predicted probabilities will lie further from 0).
      """
      if (
          (problem_type == REGRESSION)
          and (len(y_predprob.shape) > 1)
          and (y_predprob.shape[1] > 1)
      ):
          problem_type = SOFTCLASS  # this was MULTICLASS problem converted to REGRESSION (as done in distillation)
  
      if problem_type in [BINARY, REGRESSION]:
          if len(y_predprob.shape) > 1 and min(y_predprob.shape) > 1:
              raise ValueError(
                  f"cannot call normalize_pred_probas with problem_type={problem_type} and y_predprob.shape=={y_predprob.shape}"
              )
          return normalize_binary_probas(y_predprob, eps)
      elif problem_type in [
          MULTICLASS,
          SOFTCLASS,
      ]:  # clip all probs below at eps and then renormalize
          if len(y_predprob.shape) == 1:
              return normalize_binary_probas(y_predprob, eps)
          else:
              return normalize_multi_probas(y_predprob, eps)
      else:
          raise ValueError(f"Invalid problem_type")
  
imports: import logging
  import math
  import pickle
  import random
  import sys
  import time
  from typing import Callable, List, Tuple, Union
  import numpy
  import pandas
  import scipy.stats
  from numpy.typing import ArrayLike
  from pandas import DataFrame, Series
  from sklearn.model_selection import LeaveOneGroupOut, RepeatedKFold, RepeatedStratifiedKFold, train_test_split
  from autogluon.common.utils.resource_utils import ResourceManager
  from ..constants import BINARY, LARGE_DATA_THRESHOLD, MULTICLASS, MULTICLASS_UPPER_LIMIT, QUANTILE, REGRESS_THRESHOLD_LARGE_DATA, REGRESS_THRESHOLD_SMALL_DATA, REGRESSION, SOFTCLASS
  from ..metrics import Scorer, accuracy, pinball_loss, root_mean_squared_error
  from .miscs import warning_filter
label_desc: Use image node_id 15 for calling a global function with example usage: normalize_pred_probas(y_predprob, problem_type, eps) and returns: normalize_binary_probas, normalize_binary_probas, normalize_multi_probas