@cache
def axis_sort(S, axis=-1, index=False, value=None):

    if value is None:
        value = np.argmax

    if S.ndim != 2:
        raise ParameterError('axis_sort is only defined for 2D arrays')

    bin_idx = value(S, axis=np.mod(1-axis, S.ndim))
    idx = np.argsort(bin_idx)

    sort_slice = [slice(None)] * S.ndim
    sort_slice[axis] = idx

    if index:
        return S[sort_slice], idx
    else:
        return S[sort_slice]
Writes 16-bit unsigned big-endian integer into the stream
dataset/ETHPy150Open bmcfee/librosa/librosa/util/utils.py/axis_sort--crossover with--dataset/ETHPy150Open denisenkom/pytds/pytds/tds.py/_TdsWriter.put_usmallint_be