code: def get_data(train_or_test):
      # completely copied from imagenet-resnet.py example
      isTrain = train_or_test == "train"
  
      datadir = args.data
      ds = dataset.ILSVRC12(datadir, train_or_test, shuffle=isTrain)
      augmentors = fbresnet_augmentor(isTrain)
      augmentors.append(imgaug.ToUint8())
  
      ds = AugmentImageComponent(ds, augmentors, copy=False)
      if isTrain:
          ds = MultiProcessRunnerZMQ(
              ds, min(25, multiprocessing.cpu_count())
          )
      ds = BatchData(ds, BATCH_SIZE, remainder=not isTrain)
      return ds
  
imports: import argparse
  import multiprocessing
  import numpy
  import os
  import sys
  import cv2
  import tensorflow
  from tensorpack import *
  from tensorpack.dataflow import dataset
  from tensorpack.tfutils import gradproc, optimizer
  from tensorpack.tfutils.summary import *
  from tensorpack.utils import viz
  from tensorpack.utils.gpu import get_num_gpu
  from imagenet_utils import ImageNetModel, fbresnet_augmentor
  from resnet_model import preresnet_basicblock, preresnet_group
label_desc: Use image node_id 1 for calling a global function with example usage: get_data(train_or_test) and returns: ds