code: def augment_image(image, pad):
      """Perform zero padding, randomly crop image to original size,
      maybe mirror horizontally"""
      init_shape = image.shape
      new_shape = [
          init_shape[0] + pad * 2,
          init_shape[1] + pad * 2,
          init_shape[2],
      ]
      zeros_padded = np.zeros(new_shape)
      zeros_padded[
          pad : init_shape[0] + pad, pad : init_shape[1] + pad, :
      ] = image
      # randomly crop to original size
      init_x = np.random.randint(0, pad * 2)
      init_y = np.random.randint(0, pad * 2)
      cropped = zeros_padded[
          init_x : init_x + init_shape[0],
          init_y : init_y + init_shape[1],
          :,
      ]
      flip = random.getrandbits(1)
      if flip:
          cropped = cropped[:, ::-1, :]
      return cropped
  
imports: import tempfile
  import os
  import pickle
  import random
  import numpy
  from ..data_providers.base_provider import ImagesDataSet, DataProvider
  from ..data_providers.downloader import download_data_url
label_desc: Use image node_id 1 for calling a global function with example usage: augment_image(image, pad) and returns: cropped