code: def postprocess_label(scores: Dict) -> Dict:
      sorted_pred = sorted(
          scores.items(), key=operator.itemgetter(1), reverse=True
      )
      return {
          "label": sorted_pred[0][0],
          "confidences": [
              {"label": pred[0], "confidence": pred[1]}
              for pred in sorted_pred
          ],
      }
  
file_path: gradio/gradio/external_utils.py
imports: import base64
  import math
  import operator
  import re
  import warnings
  from typing import Dict, List, Tuple
  import httpx
  import yaml
  from gradio import components
label_desc: Use image node_id 4 for calling a global function with example usage: postprocess_label(scores) and returns: dict