code: def test_cupy_makeARGB_against_generated_references():
      prev_setting = getConfigOption("useCupy")
      try:
          setConfigOption("useCupy", True)
  
          cupy = getCupy()
  
          def assert_cupy_correct(
              data, key, levels, lut, scale, use_rgba
          ):
              data = cupy.asarray(data)
              if lut is not None:
                  lut = cupy.asarray(lut)
              expectation = EXPECTED_OUTPUTS[key]
              if isinstance(expectation, type) and issubclass(
                  expectation, Exception
              ):
                  try:
                      _makeARGB(
                          data,
                          lut=lut,
                          levels=levels,
                          scale=scale,
                          useRGBA=use_rgba,
                      )
                  except Exception as e:
                      assert expectation == type(e)
                  else:
                      assert (
                          False
                      ), f"makeARGB({key!r}) was supposed to raise {expectation} but didn't raise anything."
              else:
                  expectation = cupy.asarray(expectation)
                  output, alpha = _makeARGB(
                      data,
                      lut=lut,
                      levels=levels,
                      scale=scale,
                      useRGBA=use_rgba,
                  )
                  assert (
                      output == expectation
                  ).all(), f"Incorrect _makeARGB({key!r}) output! Expected:\n{expectation!r}\n  Got:\n{output!r}"
  
          _do_something_for_every_combo(assert_cupy_correct)
      finally:
          setConfigOption("useCupy", prev_setting)
  
file_path: pyqtgraph/tests/test_makeARGB.py
imports: import sys
  from typing import Any, Dict, Type, Union
  import numpy
  import pytest
  from pyqtgraph import getConfigOption, getCupy, setConfigOption
  from pyqtgraph.functions import makeARGB
label_desc: Use image node_id 6 for calling a global function with example usage: test_cupy_makeARGB_against_generated_references() without return types