code: def _cmplx_sort(p):
      """Sort roots based on magnitude."""
      indx = cupy.argsort(cupy.abs(p))
      return cupy.take(p, indx, 0), indx
  
file_path: cupy/cupyx/scipy/signal/_polyutils.py
imports: import cupy
label_desc: Use image node_id 3 for calling a global function with example usage: _cmplx_sort(p) and returns: cupy,  indx