code: def test_that_python_args_fail(ctx_factory):
      context = ctx_factory()
  
      prg = cl.Program(
          context,
          """
          __kernel void mult(__global float *a, float b, int c)
          { a[get_global_id(0)] *= (b+c); }
          """,
      ).build()
  
      rng = np.random.default_rng(seed=42)
      a = rng.random(50000)
      queue = cl.CommandQueue(context)
      mf = cl.mem_flags
      a_buf = cl.Buffer(
          context, mf.READ_WRITE | mf.COPY_HOST_PTR, hostbuf=a
      )
  
      knl = cl.Kernel(prg, "mult")
      try:
          knl(queue, a.shape, None, a_buf, 2, 3)
          raise AssertionError(
              "PyOpenCL should not accept bare Python types as arguments"
          )
      except cl.LogicError:
          pass
  
      try:
          prg.mult(queue, a.shape, None, a_buf, float(2), 3)
          raise AssertionError(
              "PyOpenCL should not accept bare Python types as arguments"
          )
      except cl.LogicError:
          pass
  
      prg.mult(queue, a.shape, None, a_buf, np.float32(2), np.int32(3))
  
      a_result = np.empty_like(a)
      cl.enqueue_copy(queue, a_buf, a_result).wait()
  
imports: import numpy
  import numpy.linalg
  import pytest
  import pyopencl
  import pyopencl.array
  import pyopencl.cltypes
  import pyopencl.clrandom
  from pyopencl.tools import pytest_generate_tests_for_pyopencl, ImmediateAllocator, DeferredAllocator
  from pyopencl.characterize import get_pocl_version
label_desc: Use image node_id 9 for calling a global function with example usage: test_that_python_args_fail(ctx_factory) without return types