code: def test_cntk_model(
      model_name, use_external_files_to_store_parameters
  ):
      if model_name in skip_cntk_model_names:
          pytest.skip("Skip cntk model test. ")
      cntk_base_dir = get_base_dir("PretrainedModelsV2")
  
      model_dir = os.path.join(cntk_base_dir, model_name)
      model = C.Function.load(model_dir, format=C.ModelFormat.CNTKv2)
  
      resave_model_dir = os.path.join(tmpdir, "test_" + model_name)
      if use_external_files_to_store_parameters:
          resave_model_dir += "_ext"
      resave_model_path = os.path.join(resave_model_dir, model_file)
  
      np.random.seed(3)
      input_shape = (1,) + model.arguments[0].shape
      data_x = np.asarray(
          np.random.uniform(-1, 1, input_shape), dtype=np.float32
      )
      data_y = model.eval({model.arguments[0]: data_x})
  
      Save(
          resave_model_dir,
          model,
          data_x,
          data_y,
          use_external_files_to_store_parameters=use_external_files_to_store_parameters,
      )
  
      # CNTK evaluation fails imported ResNet110 model because of its depth.
      if model_name != "ResNet110_CIFAR10_CNTK.model":
          reloaded_model = C.Function.load(
              resave_model_path, format=C.ModelFormat.ONNX
          )
          data_y_ = reloaded_model.eval(
              {reloaded_model.arguments[0]: data_x}
          )
  
          np.testing.assert_equal(len(data_y), len(data_y_))
          for i in range(len(data_y)):
              np.testing.assert_equal(data_y[i].dtype, data_y_[i].dtype)
              np.testing.assert_allclose(
                  data_y[i], data_y_[i], rtol=1e-3, atol=1e-4
              )
  
      verify_results_with_onnxruntime(
          model_name, str(os.path.abspath(tmpdir))
      )
  
file_path: CNTK/bindings/python/cntk/tests/onnx_model_test.py
imports: import cntk
  import numpy
  import pytest
  import os
  import re
  import shutil
  import time
  import tempfile
  from onnx import numpy_helper
  from .onnx_verify_helper import generate_sequence_data, generate_sequential_data, generate_sparse_data, verify_results_with_onnxruntime, generate_sparse_data_non_seq
  from .onnx_test_helper import find_onnx_value_info_proto_with_matching_name, save_cntk_data_as_onnx_tensor, save_test_data, save_onnx_model_with_validation_data
  from .onnx_op_test import verify_sequence_model
label_desc: Use image node_id 5 for calling a global function with example usage: test_cntk_model(model_name, use_external_files_to_store_parameters) without return types