code: def get_data(train_or_test):
      isTrain = train_or_test == "train"
      ds = dataset.Cifar10(train_or_test)
      pp_mean = ds.get_per_pixel_mean(("train",))
      if isTrain:
          augmentors = [
              imgaug.CenterPaste((40, 40)),
              imgaug.RandomCrop((32, 32)),
              imgaug.Flip(horiz=True),
              imgaug.MapImage(lambda x: x - pp_mean),
          ]
      else:
          augmentors = [imgaug.MapImage(lambda x: x - pp_mean)]
      ds = AugmentImageComponent(ds, augmentors)
      ds = BatchData(ds, BATCH_SIZE, remainder=not isTrain)
      if isTrain:
          ds = MultiProcessRunner(ds, 3, 2)
      return ds
  
file_path: tensorpack/examples/ResNet/cifar10-resnet.py
imports: import argparse
  import os
  from tensorpack import tfv1
  from tensorpack import *
  from tensorpack.dataflow import dataset
  from tensorpack.tfutils.summary import add_moving_summary, add_param_summary
  from tensorpack.utils.gpu import get_num_gpu
label_desc: Use image node_id 1 for calling a global function with example usage: get_data(train_or_test) and returns: ds