code: def dispatch_queue(loader):
      # type: (DataLoader) -> None
      
      # 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)
docs: Given the current state of a Loader instance, perform a batch load
      from its current queue.