code: def assert_image_equal(a, b, msg=None):
      assert a.mode == b.mode, (
          msg or f"got mode {repr(a.mode)}, expected {repr(b.mode)}"
      )
      assert a.size == b.size, (
          msg or f"got size {repr(a.size)}, expected {repr(b.size)}"
      )
      if a.tobytes() != b.tobytes():
          if HAS_UPLOADER:
              try:
                  url = test_image_results.upload(a, b)
                  logger.error(f"Url for test images: {url}")
              except Exception:
                  pass
  
          assert False, msg or "got different content"
  
imports: import logging
  import os
  import shutil
  import sys
  import sysconfig
  import tempfile
  from io import BytesIO
  import pytest
  from packaging.version import parse
  from PIL import Image, ImageMath, features
label_desc: Use image node_id 4 for calling a global function with example usage: assert_image_equal(a, b, msg) without return types