code: def translate_affine_mat(offset):
      ndim = len(offset)
      affine_mat = np.identity(ndim + 1)
      affine_mat[:ndim, -1] = offset
      return affine_mat
  
imports: import random
  import warnings
  import numpy
  from scipy.spatial.transform import Rotation
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops.transforms
  import nvidia.dali.ops
  import nvidia.dali.fn
  from nvidia.dali import pipeline_def
  from sequences_test_utils import ArgData, ArgDesc, sequence_suite_helper, ArgCb, ParamsProvider
  from nose_utils import assert_raises
label_desc: Use image node_id 3 for calling a global function with example usage: translate_affine_mat(offset) and returns: affine_mat