code: def pad_distort_ims_fn(X):
      """Zero pads images to 40x40, and distort them."""
      X_40 = []
      for X_a, _ in tl.iterate.minibatches(X, X, 50, shuffle=False):
          X_40.extend(
              tl.prepro.threading_data(X_a, fn=pad_distort_im_fn)
          )
      X_40 = np.asarray(X_40)
      return X_40
  
file_path: TensorLayer/examples/spatial_transformer_network/tutorial_spatial_transformer_network_static.py
imports: import time
  import numpy
  import tensorflow
  import tensorlayer
  from tensorlayer.layers import *
  from tensorlayer.models import Model
label_desc: Use image node_id 2 for calling a global function with example usage: pad_distort_ims_fn(X) and returns: X_40