code: def _get_shape_view(shapes_ptr, ndims_ptr, num_dims, num_samples):
      ndims = carray(
          address_as_void_pointer(ndims_ptr), num_dims, dtype=np.int32
      )
      samples = carray(
          address_as_void_pointer(shapes_ptr),
          (num_dims, num_samples),
          dtype=np.int64,
      )
      ret = []
      for sample, size in zip(samples, ndims):
          d = []
          for shape_ptr in sample:
              d.append(
                  carray(
                      address_as_void_pointer(shape_ptr),
                      size,
                      dtype=np.int64,
                  )
              )
          ret.append(d)
      return ret
  
imports: from distutils.version import LooseVersion
  from nvidia.dali import backend
  from nvidia.dali.pipeline import Pipeline
  from nvidia.dali.data_node import DataNode
  from nvidia.dali import ops
  from nvidia.dali import types
  from numba import types
  from numba import njit, cfunc, carray, cuda
  import numpy
  import numba
label_desc: Use image node_id 2 for calling a global function with example usage: _get_shape_view(shapes_ptr, ndims_ptr, num_dims, num_samples) and returns: ret