code: def augmentation(x, batch_size):
      xpad = np.pad(x, [[0, 0], [0, 0], [4, 4], [4, 4]], "symmetric")
      for data_num in range(0, batch_size):
          offset = np.random.randint(8, size=2)
          x[data_num, :, :, :] = xpad[
              data_num,
              :,
              offset[0] : offset[0] + x.shape[2],
              offset[1] : offset[1] + x.shape[2],
          ]
          if_flip = np.random.randint(2)
          if if_flip:
              x[data_num, :, :, :] = x[data_num, :, :, ::-1]
      return x
  
file_path: singa/examples/cnn/train_cnn.py
imports: from singa import singa_wrap
  from singa import device
  from singa import tensor
  from singa import opt
  import numpy
  import time
  import argparse
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: augmentation(x, batch_size) and returns: x