code: def argmaxn(value_list, n, order="desc"):
      """Return the index of top n elements in the list
      if order is set to 'desc', otherwise return the index of n smallest ones.
  
      Parameters
      ----------
      value_list : list, array, numpy array of shape (n_samples,)
          A list containing all values.
  
      n : int
          The number of elements to select.
  
      order : str, optional (default='desc')
          The order to sort {'desc', 'asc'}:
  
          - 'desc': descending
          - 'asc': ascending
  
      Returns
      -------
      index_list : numpy array of shape (n,)
          The index of the top n elements.
      """
  
      value_list = column_or_1d(value_list)
      length = len(value_list)
  
      # validate the choice of n
      check_parameter(
          n,
          1,
          length,
          include_left=True,
          include_right=True,
          param_name="n",
      )
  
      # for the smallest n, flip the value
      if order != "desc":
          n = length - n
  
      value_sorted = np.partition(value_list, length - n)
      threshold = value_sorted[int(length - n)]
  
      if order == "desc":
          return np.where(np.greater_equal(value_list, threshold))[0]
      else:  # return the index of n smallest elements
          return np.where(np.less(value_list, threshold))[0]
  
imports: from __future__ import division
  from __future__ import print_function
  import numbers
  import numpy
  import sklearn
  from numpy import percentile
  from sklearn.metrics import precision_score
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils import check_array
  from sklearn.utils import check_consistent_length
  from sklearn.utils import check_random_state
  from sklearn.utils import column_or_1d
  from sklearn.utils.random import sample_without_replacement
label_desc: Use image node_id 10 for calling a global function with example usage: argmaxn(value_list, n, order) and returns: np, np