code: def testInTopK(self, dtype):
      if dtype in self.numeric_types:
          array_size = 200 * 1000
          k_options = [0, 1, 2, 10, 20, 100, 1000, 200 * 1000]
          batch = 16
          for x in [np.arange(batch * array_size)]:
              np.random.shuffle(x)
              x = np.reshape(x, [batch, array_size])
              y = np.random.randint(0, array_size, size=batch)
              for k in k_options:
                  indices = x.argsort(axis=1)[::, -1 : -k - 1 : -1]
                  expected = [y[i] in indices[i] for i in range(batch)]
  
                  def in_topk(predictions, targets, k=k):
                      return nn_ops.in_top_k(predictions, targets, k)
  
                  self._assertOpOutputMatchesExpected(
                      in_topk,
                      [x.astype(np.float32), y.astype(dtype)],
                      expected=[expected],
                  )
  
imports: import unittest
  from absl.testing import parameterized
  import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.compiler.tf2xla.python import xla
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import function
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import sort_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 15 for calling the XlaSortOpTest obj's underlying member method code with example usage: obj.testInTopK(dtype) and returns: nn_ops