code: def boxes_sort(boxes):
      """From left top to right bottom
      Params:
          boxes: [[x1, y1, x2, y2], [x1, y1, x2, y2], ...]
      """
      sorted_id = sorted(range(len(boxes)), key=lambda x: (boxes[x][1]))
  
      # sorted_boxes = [boxes[id] for id in sorted_id]
  
      return sorted_id
  
imports: from typing import List, Union, Any, Tuple, Optional
  import requests
  import torch
  from langchain.docstore.document import Document
  from langchain.document_loaders import ImageCaptionLoader
  import numpy
  from utils import get_device, clear_torch_cache, NullContext
  from doctr.utils.common_types import AbstractFile
label_desc: Use image node_id 1 for calling a global function with example usage: boxes_sort(boxes) and returns: sorted_id