code: def test_partition(ctx_factory):
      from pytest import importorskip
  
      importorskip("mako")
  
      context = ctx_factory()
      queue = cl.CommandQueue(context)
  
      from pyopencl.clrandom import rand as clrand
  
      for n in scan_test_counts:
          print("part", n)
  
          a_dev = clrand(queue, (n,), dtype=np.int32, a=0, b=1000)
          a = a_dev.get()
  
          crit = a_dev.dtype.type(300)
          true_host = a[a > crit]
          false_host = a[a <= crit]
  
          from pyopencl.algorithm import partition
  
          true_dev, false_dev, count_true_dev, evt = partition(
              a_dev, "ary[i] > myval", [("myval", crit)]
          )
  
          count_true_dev = count_true_dev.get()
  
          assert (true_dev.get()[:count_true_dev] == true_host).all()
          assert (
              false_dev.get()[: n - count_true_dev] == false_host
          ).all()
  
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 22 for calling a global function with example usage: test_partition(ctx_factory) without return types