code: def _sort(x, y=None, param=0):
      """sort x (and y, if provided) by the given parameter
  
      Args:
        x (ndarray): an array of shape ``(npts, nparam)``
        y (ndarray, default=None): an array of shape ``(npts,)``
        param (int, default=0): index of ``nparam`` upon which to sort
  
      Returns:
        sorted ``x``, or tuple of sorted ``(x,y)`` if ``y`` is provided
  
      Examples:
        >>> _sort([[1,5,9],[7,8,3],[4,2,6]], param=0)
        array([[1, 5, 9],
               [4, 2, 6],
               [7, 8, 3]])
  
        >>> _sort([[1,5,9],[7,8,3],[4,2,6]], param=1)
        array([[4, 2, 6],
               [1, 5, 9],
               [7, 8, 3]])
  
        >>> _sort([[1,5,9],[7,8,3],[4,2,6]], [4,3,2])
        (array([[1, 5, 9],
               [4, 2, 6],
               [7, 8, 3]]), array([4, 2, 3]))
      """
      import numpy as np
  
      x = np.asarray(x)
      i = np.argsort(x, axis=0)[:, param]
      if y is None:
          return x[i]
      y = np.asarray(y)
      return x[i], y[i]
  
imports: from mystic.math import _rbf
label_desc: Use image node_id 3 for calling a global function with example usage: _sort(x, y, param) and returns: x,  y, x