code: def find_best_temp_scaler(
      labels_multiannotator: np.ndarray,
      pred_probs: np.ndarray,
      coarse_search_range: list = [0.1, 0.2, 0.5, 0.8, 1, 2, 3, 5, 8],
      fine_search_size: int = 4,
  ) -> float:
      """Find the best temperature scaling factor that minimizes the soft cross entropy between the annotators' empirical label distribution
      and model pred_probs"""
  
      soft_cross_entropy_coarse = np.full(
          len(coarse_search_range), np.NaN
      )
      log_pred_probs = np.log(
          pred_probs,
          where=pred_probs > 0,
          out=np.full(pred_probs.shape, -np.inf),
      )
      for i, curr_temp in enumerate(coarse_search_range):
          scaled_pred_probs = softmax(
              log_pred_probs, temperature=curr_temp, axis=1, shift=False
          )
          soft_cross_entropy_coarse[i] = np.mean(
              compute_soft_cross_entropy(
                  labels_multiannotator, scaled_pred_probs
              )
          )
  
      min_entropy_ind = np.argmin(soft_cross_entropy_coarse)
      fine_search_range = _set_fine_search_range(
          coarse_search_range, fine_search_size, min_entropy_ind
      )
      soft_cross_entropy_fine = np.full(len(fine_search_range), np.NaN)
      for i, curr_temp in enumerate(fine_search_range):
          scaled_pred_probs = softmax(
              log_pred_probs, temperature=curr_temp, axis=1, shift=False
          )
          soft_cross_entropy_fine[i] = np.mean(
              compute_soft_cross_entropy(
                  labels_multiannotator, scaled_pred_probs
              )
          )
      best_temp = fine_search_range[np.argmin(soft_cross_entropy_fine)]
      return best_temp
  
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 6 for calling a global function with example usage: find_best_temp_scaler(labels_multiannotator, pred_probs, coarse_search_range, fine_search_size) and returns: best_temp