code: def _select_ids(x, side="top"):
      assert side in ["top", "bottom"]
      if side == "top":
          return np.argsort(-x)
      elif side == "bottom":
          return np.argsort(x)
  
imports: import numpy
  from scipy.stats import rankdata
label_desc: Use image node_id 4 for calling a global function with example usage: _select_ids(x, side) and returns: np, np