class_docstr: Simple indexer class
class_docstr_tok: ["Simple","indexer","class"]
code: def _get_sorted_top_k(
      dist: "np.array", top_k: int
  ) -> Tuple["np.ndarray", "np.ndarray"]:
      if top_k >= dist.shape[1]:
          idx = dist.argsort(axis=1)[:, :top_k]
          dist = np.take_along_axis(dist, idx, axis=1)
      else:
          idx_ps = dist.argpartition(kth=top_k, axis=1)[:, :top_k]
          dist = np.take_along_axis(dist, idx_ps, axis=1)
          idx_fs = dist.argsort(axis=1)
          idx = np.take_along_axis(idx_ps, idx_fs, axis=1)
          dist = np.take_along_axis(dist, idx_fs, axis=1)
  
      return idx, dist
  
file_path: jina/tests/integration/crud/__init__.py
imports: import os
  from typing import Dict, Tuple
  import numpy
  from jina import Document, DocumentArray, Executor, requests
  from jina.logging.logger import JinaLogger
label_desc: Use image node_id 7 for calling the CrudIndexer obj's underlying member method code with example usage: obj._get_sorted_top_k(dist, top_k) and returns: idx,  dist