code: def dispatch_queue(loader):
      # type: (DataLoader) -> None
      """
      Given the current state of a Loader instance, perform a batch load
      from its current queue.
      """
      # Take the current loader queue, replacing it with an empty queue.
      queue = loader._queue
      loader._queue = []
  
      # If a maxBatchSize was provided and the queue is longer, then segment the
      # queue into multiple batches, otherwise treat the queue as a single batch.
      max_batch_size = loader.max_batch_size
  
      if max_batch_size and max_batch_size < len(queue):
          chunks = get_chunks(queue, max_batch_size)
          for chunk in chunks:
              dispatch_queue_batch(loader, chunk)
      else:
          dispatch_queue_batch(loader, queue)
  
file_path: wandb/wandb/vendor/promise-2.3.0/wandb_promise/dataloader.py
imports: from collections import namedtuple
  from functools import partial
  from threading import local
  from .promise import Promise, async_instance, get_default_scheduler
label_desc: Use image node_id 3 for calling a global function with example usage: dispatch_queue(loader) without return types