code: def test_topk_execution(
      setup, chunk_size, axis, largest, to_sort, parallel_kind
  ):
      raw1, order1 = np.random.rand(5, 6, 7), None
      raw2 = np.empty(
          (5, 6, 7), dtype=[("a", np.int32), ("b", np.float64)]
      )
      raw2["a"] = np.random.randint(
          1000, size=(5, 6, 7), dtype=np.int32
      )
      raw2["b"] = np.random.rand(5, 6, 7)
      order2 = ["b", "a"]
  
      for raw, order in [(raw1, order1), (raw2, order2)]:
          a = tensor(raw, chunk_size=chunk_size)
          size = raw.shape[axis] if axis is not None else raw.size
          for k in [2, size - 2, size, size + 2]:
              r = topk(
                  a,
                  k,
                  axis=axis,
                  largest=largest,
                  sorted=to_sort,
                  order=order,
                  parallel_kind=parallel_kind,
              )
  
              result = r.execute().fetch()
  
              if not to_sort:
                  result = _handle_result(result, axis, largest, order)
              expected = _topk_slow(raw, k, axis, largest, order)
              np.testing.assert_array_equal(result, expected)
  
              r = topk(
                  a,
                  k,
                  axis=axis,
                  largest=largest,
                  sorted=to_sort,
                  order=order,
                  parallel_kind=parallel_kind,
                  return_index=True,
              )
  
              ta, ti = r.execute().fetch()
              raw2 = raw
              if axis is None:
                  raw2 = raw.flatten()
              np.testing.assert_array_equal(
                  ta, np.take_along_axis(raw2, ti, axis)
              )
              if not to_sort:
                  ta = _handle_result(ta, axis, largest, order)
              np.testing.assert_array_equal(ta, expected)
  
imports: import numpy
  import scipy.sparse
  import pandas
  import pytest
  from ....None import dataframe
  from ....None import tensor
  from ....None import execute, fetch
  from ....tests.core import require_cupy
  from ...datasource import tensor, ones, zeros, arange
  from ..None import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, diff, ediff1d, flip, flipud, fliplr, repeat, tile, isin, searchsorted, unique, sort, argsort, partition, argpartition, topk, argtopk, trapz, shape, to_gpu, to_cpu, swapaxes
label_desc: Use image node_id 40 for calling a global function with example usage: test_topk_execution(setup, chunk_size, axis, largest, to_sort, parallel_kind) without return types