code: def temp_scale_pred_probs(
      pred_probs: np.ndarray,
      temp: float,
  ) -> np.ndarray:
      """Scales pred_probs by the given temperature factor. Temperature of <1 will sharpen the pred_probs while temperatures of >1 will smoothen it."""
      # clip pred_probs to prevent taking log of 0
      pred_probs = np.clip(pred_probs, a_min=SMALL_CONST, a_max=None)
      pred_probs = (
          pred_probs / np.sum(pred_probs, axis=1)[:, np.newaxis]
      )
  
      # apply temperate scale
      scaled_pred_probs = softmax(
          np.log(pred_probs), temperature=temp, axis=1, shift=False
      )
      scaled_pred_probs = (
          scaled_pred_probs
          / np.sum(scaled_pred_probs, axis=1)[:, np.newaxis]
      )  # normalize
  
      return scaled_pred_probs
  
file_path: cleanlab/cleanlab/internal/multiannotator_utils.py
imports: from cleanlab.typing import LabelLike
  from typing import Optional, Tuple
  import warnings
  import numpy
  import pandas
  from cleanlab.internal.validation import assert_valid_class_labels
  from cleanlab.internal.numerics import softmax
  from cleanlab.internal.util import get_num_classes, value_counts
label_desc: Use image node_id 8 for calling a global function with example usage: temp_scale_pred_probs(pred_probs, temp) and returns: scaled_pred_probs