code: def get_mapping(shape):
      h, w = shape
      x = np.arange(w, dtype=np.float32) + 0.5
      y = np.arange(h, dtype=np.float32) + 0.5
      xy = np.transpose([np.tile(x, h), np.repeat(y, w)]).reshape(
          [h, w, 2]
      )
      center = np.array([[[w * 0.5, h * 0.5]]])
      d = xy - center
      dnorm = np.linalg.norm(d, ord=2, axis=2)
      dexp1 = dnorm * (7 / np.sqrt(w * w + h * h))
      dexp2 = dnorm * (9 / np.sqrt(w * w + h * h))
      mag = np.exp(-(dexp1**2)) - np.exp(-(dexp2**2))
      od = d + 0
      od[:, :, 0] = d[:, :, 0] * (1 - mag) + d[:, :, 1] * mag
      od[:, :, 1] = d[:, :, 1] * (1 - mag) + d[:, :, 0] * mag
  
      ofs = od - d
  
      return xy, ofs
  
imports: import os
  import numpy
  import platform
  import random
  import cv2
  from nvidia.dali.pipeline import pipeline_def
  from nvidia.dali import fn, types
  from test_utils import get_dali_extra_path, get_arch
  from nose_utils import raises, assert_raises
  from nose import SkipTest
label_desc: Use image node_id 2 for calling a global function with example usage: get_mapping(shape) and returns: xy,  ofs