code: def get_pipeline(device, batch_size, tile, ratio, angle):
      pipe = Pipeline(batch_size, 4, 0)
      with pipe:
          input, _ = fn.readers.file(file_root=img_dir)
          decoded = fn.decoders.image(
              input, device="cpu", output_type=types.RGB
          )
          decoded = decoded.gpu() if device == "gpu" else decoded
          grided = fn.grid_mask(
              decoded,
              device=device,
              tile=tile,
              ratio=ratio,
              angle=angle,
          )
          pipe.set_outputs(grided, decoded)
      return pipe
  
file_path: DALI/dali/test/python/operator_1/test_gridmask.py
imports: from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.fn
  import nvidia.dali.types
  import numpy
  import math
  import os
  import cv2
  import itertools
  from nose2.tools import params
  from test_utils import get_dali_extra_path
label_desc: Use image node_id 1 for calling a global function with example usage: get_pipeline(device, batch_size, tile, ratio, angle) and returns: pipe