code: def apply_temperature_scaling(
      y_pred_proba: np.ndarray,
      temperature_scalar: float,
      problem_type: str,
  ) -> np.ndarray:
      # TODO: This is expensive to convert at inference time, try to avoid in future
      if problem_type == BINARY:
          y_pred_proba = LabelCleanerMulticlassToBinary.convert_binary_proba_to_multiclass_proba(
              y_pred_proba
          )
  
      logits = np.log(y_pred_proba)
      y_pred_proba = custom_softmax(logits=logits / temperature_scalar)
  
      if problem_type == BINARY:
          y_pred_proba = y_pred_proba[:, 1]
  
      return y_pred_proba
  
imports: import numpy
  from autogluon.common.utils.try_import import try_import_torch
  from ..constants import BINARY
  from ..data.label_cleaner import LabelCleanerMulticlassToBinary
label_desc: Use image node_id 3 for calling a global function with example usage: apply_temperature_scaling(y_pred_proba, temperature_scalar, problem_type) and returns: y_pred_proba