code: def __call__(self, X, Y):
      from .pairwise import pairwise_distances
  
      # leverage pairwise_distances for checks
      d = pairwise_distances(
          X, Y, metric=self._metric, **self._metric_kwargs
      )
  
      if self._k > Y.shape[0]:
          self._k = Y.shape[0]
  
      X, Y = d.op.inputs
  
      shape_list = [X.shape[0]]
      shape_list.append(min(Y.shape[0], self._k))
      shape = tuple(shape_list)
      kws = [
          {
              "shape": shape,
              "order": TensorOrder.C_ORDER,
              "dtype": np.dtype(np.float64),
              "_type_": "distance",
          },
      ]
      if self._return_index:
          kws.append(
              {
                  "shape": shape,
                  "order": TensorOrder.C_ORDER,
                  "dtype": np.dtype(np.int64),
                  "_type_": "index",
              }
          )
          return self.new_tensors([X, Y], kws=kws)
      else:
          return self.new_tensors([X, Y], kws=kws)[0]
  
imports: from functools import partial
  import numpy
  from ....None import opcodes
  from ....None import options
  from ....core import recursive_tile
  from ....core.operand import OperandStage
  from ....serialization.serializables import KeyField, BoolField, DictField, Int64Field, AnyField
  from ....tensor.core import TensorOrder
  from ....tensor.merge import TensorConcatenate
  from ....tensor.array_utils import as_same_device, device, get_array_module
  from ....utils import has_unknown_shape, ensure_own_data
  from ...utils import gen_batches, get_chunk_n_rows
  from ...utils.validation import _num_samples
  from .core import PairwiseDistances
label_desc: Use image node_id 12 for calling the PairwiseDistancesTopk obj's underlying member method code with example usage: obj.__call__(X, Y) and returns: self, self