code: def test_fancy_upsampling(batch_size):
      if nvidia.dali.backend.GetNvjpegVersion() < 12001:
          from nose import SkipTest
  
          raise SkipTest(
              "nvJPEG doesn't support fancy upsampling in this version"
          )
      data_path = os.path.join(test_data_root, good_path, "jpeg")
      compare_pipelines(
          decoder_pipe(
              data_path=data_path,
              batch_size=batch_size,
              num_threads=3,
              device_id=0,
              device="mixed",
              jpeg_fancy_upsampling=True,
          ),
          decoder_pipe(
              data_path=data_path,
              batch_size=batch_size,
              num_threads=3,
              device_id=0,
              device="cpu",
          ),
          batch_size=batch_size,
          N_iterations=3,
          eps=1,
      )
  
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 13 for calling a global function with example usage: test_fancy_upsampling(batch_size) without return types