code: def test_cntk_103d_mnist_convolutionalneuralnetwork_trainerror(
      nb, device_id
  ):
      if os.getenv("OS") == "Windows_NT" and sys.version_info[0] == 2:
          pytest.skip(
              "tests with Python 2.7 on Windows are not stable in the CI environment. "
          )
      metrics = []
      for cell in nb.cells:
          try:
              if cell.cell_type == "code":
                  m = re.search(
                      r"Average test error: (?P<metric>\d+\.\d+)%",
                      cell.outputs[0]["text"],
                  )
                  if m:
                      metrics.append(float(m.group("metric")))
          except IndexError:
              pass
          except KeyError:
              pass
      # TODO tighten tolerances
      assert np.allclose(
          expectedEvalErrorByDeviceId[device_id], metrics, atol=0.4
      )
  
imports: import os
  import sys
  import pytest
  import re
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_cntk_103d_mnist_convolutionalneuralnetwork_trainerror(nb, device_id) without return types