code: def decoder_pipe(
      data_path,
      device,
      use_fast_idct=False,
      memory_stats=False,
      jpeg_fancy_upsampling=False,
  ):
      inputs, labels = fn.readers.file(
          file_root=data_path, shard_id=0, num_shards=1, name="Reader"
      )
      decoded = fn.decoders.image(
          inputs,
          device=device,
          output_type=types.RGB,
          use_fast_idct=use_fast_idct,
          memory_stats=memory_stats,
          jpeg_fancy_upsampling=jpeg_fancy_upsampling,
      )
  
      return decoded, labels
  
imports: import glob
  import math
  import numpy
  import nvidia.dali.backend
  import nvidia.dali.fn
  import nvidia.dali.types
  import os
  import random
  from nvidia.dali import pipeline_def
  from nose2.tools import params
  from nose_utils import assert_raises
  from test_utils import check_output_pattern
  from test_utils import compare_pipelines
  from test_utils import get_dali_extra_path
  from test_utils import to_array
label_desc: Use image node_id 2 for calling a global function with example usage: decoder_pipe(data_path, device, use_fast_idct, memory_stats, jpeg_fancy_upsampling) and returns: decoded,  labels