code: def sort_dict(unsorted_dict, descending=False):
      """
      Sorts a dictionary in ascending order (if descending = False) or descending order (if descending = True)
      """
      if not isinstance(descending, bool):
          raise ValueError("`descending` must be a boolean")
  
      return sorted(
          unsorted_dict.items(), key=lambda x: x[1], reverse=descending
      )
  
file_path: caer/caer/core.py
imports: import cv2
  import numpy
  import gc
  from .path import listdir, join
label_desc: Use image node_id 7 for calling a global function with example usage: sort_dict(unsorted_dict, descending) and returns: sorted