code: def random_shift(image, wsr=0.1, hsr=0.1):
      """Apply random horizontal and vertical shift to images.
  
      This is the default data-augmentation strategy used on CIFAR in Glow.
  
      Args:
        image: a 3-D Tensor
        wsr: Width shift range, as a float fraction of the width.
        hsr: Height shift range, as a float fraction of the width.
      Returns:
        images: images translated by the provided wsr and hsr.
      """
      height, width, _ = common_layers.shape_list(image)
      width_range, height_range = wsr * width, hsr * height
      height_translations = tf.random_uniform(
          (1,), -height_range, height_range
      )
      width_translations = tf.random_uniform(
          (1,), -width_range, width_range
      )
      translations = tf.concat(
          (height_translations, width_translations), axis=0
      )
      return contrib.image().translate(image, translations=translations)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import io
  import os
  import numpy
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import metrics
  import tensorflow.compat.v1
label_desc: Use image node_id 11 for calling a global function with example usage: random_shift(image, wsr, hsr) and returns: contrib