code: def argsort(x, topn=None, reverse=False):
      """Efficiently calculate indices of the `topn` smallest elements in array `x`.
  
      Parameters
      ----------
      x : array_like
          Array to get the smallest element indices from.
      topn : int, optional
          Number of indices of the smallest (greatest) elements to be returned.
          If not given, indices of all elements will be returned in ascending (descending) order.
      reverse : bool, optional
          Return the `topn` greatest elements in descending order,
          instead of smallest elements in ascending order?
  
      Returns
      -------
      numpy.ndarray
          Array of `topn` indices that sort the array in the requested order.
  
      """
      x = np.asarray(
          x
      )  # unify code path for when `x` is not a np array (list, tuple...)
      if topn is None:
          topn = x.size
      if topn <= 0:
          return []
      if reverse:
          x = -x
      if topn >= x.size or not hasattr(np, "argpartition"):
          return np.argsort(x)[:topn]
      # np >= 1.8 has a fast partial argsort, use that!
      most_extreme = np.argpartition(x, topn)[:topn]
      return most_extreme.take(np.argsort(x.take(most_extreme)))
  
imports: from __future__ import with_statement
  import logging
  import math
  from gensim import utils
  import numpy
  import scipy.sparse
  from scipy.stats import entropy
  from scipy.linalg import get_blas_funcs, triu
  from scipy.linalg.lapack import get_lapack_funcs
  from scipy.special import psi
label_desc: Use image node_id 2 for calling a global function with example usage: argsort(x, topn, reverse) and returns: most_extreme, list, np