docstr: input:
      data - list of lists
      batch_size - int
docstr_tok: ["input",":","data","-","list","of","lists","batch_size","-","int"]
code: def __init__(self, data, batch_size, gpu, evaluation=False):
      """
      input:
          data - list of lists
          batch_size - int
      """
      self.batch_size = batch_size
      self.eval = evaluation
      self.gpu = gpu
  
      # shuffle
      if not evaluation:
          indices = list(range(len(data)))
          random.shuffle(indices)
          data = [data[i] for i in indices]
      # chunk into batches
      data = [
          data[i : i + batch_size]
          for i in range(0, len(data), batch_size)
      ]
      self.data = data
  
imports: import re
  import os
  import sys
  import random
  import string
  import logging
  import argparse
  from shutil import copyfile
  from datetime import datetime
  from collections import Counter
  import torch
  import msgpack
  import pandas
  from drqa.model import DocReaderModel
  from drqa.utils import str2bool
label_desc: Use image node_id 1 to create a new BatchGen object  with example: obj = BatchGen(data, batch_size, gpu, evaluation)