code: def assertImageMatch(
      im1,
      im2,
      minCorr=None,
      pxThreshold=50.0,
      pxCount=-1,
      maxPxDiff=None,
      avgPxDiff=None,
      imgDiff=None,
  ):
      """Check that two images match.
  
      Images that differ in shape or dtype will fail unconditionally.
      Further tests for similarity depend on the arguments supplied.
  
      By default, images may have no pixels that gave a value difference greater
      than 50.
  
      Parameters
      ----------
      im1 : (h, w, 4) ndarray
          Test output image
      im2 : (h, w, 4) ndarray
          Test standard image
      minCorr : float or None
          Minimum allowed correlation coefficient between corresponding image
          values (see numpy.corrcoef)
      pxThreshold : float
          Minimum value difference at which two pixels are considered different
      pxCount : int or None
          Maximum number of pixels that may differ. Default is 0, on Windows some
          tests have a value of 2.
      maxPxDiff : float or None
          Maximum allowed difference between pixels
      avgPxDiff : float or None
          Average allowed difference between pixels
      imgDiff : float or None
          Maximum allowed summed difference between images
  
      """
      assert im1.ndim == 3
      assert im1.shape[2] == 4
      assert im1.dtype == im2.dtype
  
      if pxCount == -1:
          pxCount = 0
  
      diff = im1.astype(float) - im2.astype(float)
      if imgDiff is not None:
          assert np.abs(diff).sum() <= imgDiff
  
      pxdiff = diff.max(axis=2)  # largest value difference per pixel
      mask = np.abs(pxdiff) >= pxThreshold
      if pxCount is not None:
          assert mask.sum() <= pxCount
  
      maskedDiff = diff[mask]
      if maxPxDiff is not None and maskedDiff.size > 0:
          assert maskedDiff.max() <= maxPxDiff
      if avgPxDiff is not None and maskedDiff.size > 0:
          assert maskedDiff.mean() <= avgPxDiff
  
      if minCorr is not None:
          with np.errstate(invalid="ignore"):
              corr = np.corrcoef(im1.ravel(), im2.ravel())[0, 1]
          assert corr >= minCorr
  
imports: import inspect
  import os
  import sys
  import time
  from pathlib import Path
  import numpy
  from pyqtgraph import GraphicsLayoutWidget, ImageItem, TextItem
  from pyqtgraph import functions
  from pyqtgraph.Qt import QtCore, QtGui, QtWidgets
label_desc: Use image node_id 4 for calling a global function with example usage: assertImageMatch(im1, im2, minCorr, pxThreshold, pxCount, maxPxDiff, avgPxDiff, imgDiff) without return types