code: def _testimpl_types_and_shapes(
      device,
      shapes,
      type,
      batch_size,
      num_threads,
      fortran_order_arg,
      file_arg_type,
      cache_header_information,
      dont_use_mmap=False,
      enable_o_direct=False,
  ):
      """compare reader with numpy, with different batch_size and num_threads"""
      nsamples = len(shapes)
  
      with tempfile.TemporaryDirectory(
          prefix=gds_data_root
      ) as test_data_root:
          # setup file
          filenames = [
              "test_{:02d}.npy".format(i) for i in range(nsamples)
          ]
          full_paths = [
              os.path.join(test_data_root, fname) for fname in filenames
          ]
          for i in range(nsamples):
              fortran_order = fortran_order_arg
              if fortran_order is None:
                  fortran_order = random.choice([False, True])
              create_numpy_file(
                  full_paths[i], shapes[i], type, fortran_order
              )
  
          # load manually
          arrays = [np.load(filename) for filename in full_paths]
  
          # load with numpy reader
          file_list_arg = None
          files_arg = None
          file_filter_arg = None
          if file_arg_type == "file_list":
              file_list_arg = os.path.join(test_data_root, "input.lst")
              with open(file_list_arg, "w") as f:
                  f.writelines("\n".join(filenames))
          elif file_arg_type == "files":
              files_arg = filenames
          elif file_arg_type == "file_filter":
              file_filter_arg = "*.npy"
          else:
              assert False
  
          pipe = NumpyReaderPipeline(
              path=test_data_root,
              files=files_arg,
              file_list=file_list_arg,
              file_filter=file_filter_arg,
              cache_header_information=cache_header_information,
              device=device,
              batch_size=batch_size,
              num_threads=num_threads,
              device_id=0,
              dont_use_mmap=dont_use_mmap,
              enable_o_direct=enable_o_direct,
          )
          try:
              pipe.build()
              i = 0
              while i < nsamples:
                  pipe_out = pipe.run()
                  for s in range(batch_size):
                      if i == nsamples:
                          break
                      pipe_arr = to_array(pipe_out[0][s])
                      ref_arr = arrays[i]
                      assert_array_equal(pipe_arr, ref_arr)
                      i += 1
          finally:
              del pipe
  
imports: from nvidia.dali import Pipeline, pipeline_def
  import nvidia.dali.fn
  import nvidia.dali.types
  import nvidia.dali.backend
  import numpy
  from numpy.testing import assert_array_equal
  import os
  import platform
  import random
  import tempfile
  from nose_utils import assert_raises
  from nose import SkipTest
  from nose2.tools import params, cartesian_params
  from test_utils import compare_pipelines, to_array
label_desc: Use image node_id 5 for calling a global function with example usage: _testimpl_types_and_shapes(device, shapes, type, batch_size, num_threads, fortran_order_arg, file_arg_type, cache_header_information, dont_use_mmap, enable_o_direct) without return types