code: def get_data(isTrain):
      ds = dataset.Mnist("train" if isTrain else "test")
      # create augmentation for both training and testing
      augs = [
          imgaug.MapImage(lambda x: x * 255.0),
          imgaug.RandomResize((0.7, 1.2), (0.7, 1.2)),
          imgaug.RotationAndCropValid(45),
          imgaug.RandomPaste((IMAGE_SIZE, IMAGE_SIZE)),
          imgaug.SaltPepperNoise(white_prob=0.01, black_prob=0.01),
      ]
      ds = AugmentImageComponent(ds, augs)
  
      ds = JoinData([ds, ds])
      # stack the two digits into two channels, and label it with the sum
  
      def mapper(dp):
          return [np.stack([dp[0], dp[2]], axis=2), dp[1] + dp[3]]
  
      ds = MapData(ds, dp)
      ds = BatchData(ds, 128)
      return ds
  
file_path: tensorpack/examples/SpatialTransformer/mnist-addition.py
imports: import argparse
  import numpy
  import os
  import cv2
  from tensorpack import tfv1
  from tensorpack import *
  from tensorpack.dataflow import dataset
  from tensorpack.tfutils import gradproc, optimizer, summary
label_desc: Use image node_id 3 for calling a global function with example usage: get_data(isTrain) and returns: ds, list