code: def order_blocks(
      doc,
      doc_blocks: List[Page],
      model,
      batch_size=settings.ORDERER_BATCH_SIZE,
  ):
      add_column_counts(doc, doc_blocks, model, batch_size)
  
      for page_blocks in doc_blocks:
          if page_blocks.column_count > 1:
              # Resort blocks based on position
              split_pos = page_blocks.x_start + page_blocks.width / 2
              left_blocks = []
              right_blocks = []
              for block in page_blocks.blocks:
                  if block.x_start <= split_pos:
                      left_blocks.append(block)
                  else:
                      right_blocks.append(block)
              page_blocks.blocks = left_blocks + right_blocks
      return doc_blocks
  
file_path: pdf-to-markdown/marker/ordering.py
imports: from copy import deepcopy
  from typing import List
  import torch
  import sys, os
  from marker.extract_text import convert_single_page
  from transformers import LayoutLMv3ForSequenceClassification, LayoutLMv3Processor
  from PIL import Image
  import io
  from marker.schema import Page
  from marker.settings import settings
label_desc: Use image node_id 5 for calling a global function with example usage: order_blocks(doc, doc_blocks, model, batch_size) and returns: doc_blocks