code: def summarize_error(obtained, desired, orig, thresh=1e-5):
      from pytest import importorskip
  
      importorskip("mako")
  
      err = obtained - desired
      ok_count = 0
      bad_count = 0
  
      bad_limit = 200
  
      def summarize_counts():
          if ok_count:
              entries.append("<%d ok>" % ok_count)
          if bad_count >= bad_limit:
              entries.append("<%d more bad>" % (bad_count - bad_limit))
  
      entries = []
      for i, val in enumerate(err):
          if abs(val) > thresh:
              if ok_count:
                  summarize_counts()
                  ok_count = 0
  
              bad_count += 1
  
              if bad_count < bad_limit:
                  entries.append(
                      "{!r} (want: {!r}, got: {!r}, orig: {!r})".format(
                          obtained[i], desired[i], obtained[i], orig[i]
                      )
                  )
          else:
              if bad_count:
                  summarize_counts()
                  bad_count = 0
  
              ok_count += 1
  
      summarize_counts()
  
      return " ".join(entries)
  
imports: import numpy
  import numpy.linalg
  import sys
  from pytools import memoize
  from test_array import general_clrand
  import pytest
  import pyopencl
  import pyopencl.array
  from pyopencl.tools import pytest_generate_tests_for_pyopencl
  from pyopencl.characterize import has_double_support, has_struct_arg_count_bug
  from pyopencl.scan import InclusiveScanKernel, ExclusiveScanKernel, GenericScanKernel, GenericDebugScanKernel
  from pyopencl.characterize import get_pocl_version
label_desc: Use image node_id 18 for calling a global function with example usage: summarize_error(obtained, desired, orig, thresh) and returns: str