code: def test_argtopk_1d_collision(self, size, k, dtype, sorted):
      # with non-unique kth max value
      if isinstance(k, str):
          k = eval(k.replace("n", str(size)))
  
      x = theano.tensor.vector(name="x", dtype=dtype)
      y = argtopk(x, k, sorted=sorted, idx_dtype="int32")
      # DebugMode won't like the index change on collision on CPU
      # So don't use DebugMode here.
      mode = self.mode
      if isinstance(self.mode, theano.compile.DebugMode):
          mode = theano.Mode(optimizer=mode.optimizer)
      fn = theano.function([x], y, mode=mode)
      assert any(
          [
              isinstance(n.op, self.op_class)
              for n in fn.maker.fgraph.apply_nodes
          ]
      )
      xval = np.repeat(
          np.random.uniform(-100.0, 100.0, size=size // 2).astype(
              dtype
          ),
          2,
      )
      xval = xval[np.random.permutation(size)]
      yval = fn(xval)
      idx = slice(-k, None) if k > 0 else slice(-k)
      goal = np.argsort(xval)[idx].astype("int32")
      utt.assert_allclose(np.sort(xval[yval]), np.sort(xval[goal]))
  
imports: from __future__ import absolute_import, print_function, division
  from itertools import product, chain
  from functools import reduce
  import unittest
  from theano.tests import unittest_tools
  import numpy
  import theano
  from theano import tensor
  from theano.tensor.sort import sort, SortOp
  from theano.tensor.sort import argsort, ArgSortOp
  from theano.tensor.sort import topk, argtopk, topk_and_argtopk, TopKOp
label_desc: Use image node_id 8 for calling the Test_TopK obj's underlying member method code with example usage: obj.test_argtopk_1d_collision(size, k, dtype, sorted) without return types