code: def test_topk_argtopk1(npfunc, daskfunc, split_every):
      # Test data
      k = 5
      # Test at least 3 levels of aggregation when split_every=2
      # to stress the different chunk, combine, aggregate kernels
      rng = np.random.default_rng()
      npa = rng.random(800)
      npb = rng.random((10, 20, 30))
  
      a = da.from_array(npa, chunks=((120, 80, 100, 200, 300),))
      b = da.from_array(npb, chunks=(4, 8, 8))
  
      # 1-dimensional arrays
      # top 5 elements, sorted descending
      assert_eq(
          npfunc(npa)[-k:][::-1],
          daskfunc(a, k, split_every=split_every),
      )
      # bottom 5 elements, sorted ascending
      assert_eq(
          npfunc(npa)[:k], daskfunc(a, -k, split_every=split_every)
      )
  
      # n-dimensional arrays
      # also testing when k > chunk
      # top 5 elements, sorted descending
      assert_eq(
          npfunc(npb, axis=0)[-k:, :, :][::-1, :, :],
          daskfunc(b, k, axis=0, split_every=split_every),
      )
      assert_eq(
          npfunc(npb, axis=1)[:, -k:, :][:, ::-1, :],
          daskfunc(b, k, axis=1, split_every=split_every),
      )
      assert_eq(
          npfunc(npb, axis=-1)[:, :, -k:][:, :, ::-1],
          daskfunc(b, k, axis=-1, split_every=split_every),
      )
      with pytest.raises(ValueError):
          daskfunc(b, k, axis=3, split_every=split_every)
  
      # bottom 5 elements, sorted ascending
      assert_eq(
          npfunc(npb, axis=0)[:k, :, :],
          daskfunc(b, -k, axis=0, split_every=split_every),
      )
      assert_eq(
          npfunc(npb, axis=1)[:, :k, :],
          daskfunc(b, -k, axis=1, split_every=split_every),
      )
      assert_eq(
          npfunc(npb, axis=-1)[:, :, :k],
          daskfunc(b, -k, axis=-1, split_every=split_every),
      )
      with pytest.raises(ValueError):
          daskfunc(b, -k, axis=3, split_every=split_every)
  
imports: from __future__ import annotations
  import os
  import warnings
  from contextlib import nullcontext
  from itertools import permutations, zip_longest
  import pytest
  import itertools
  import dask.array
  import dask.config
  from dask.array.numpy_compat import ComplexWarning, _numpy_122
  from dask.array.utils import assert_eq, same_keys
  from dask.core import get_deps
label_desc: Use image node_id 32 for calling a global function with example usage: test_topk_argtopk1(npfunc, daskfunc, split_every) without return types