def METHOD_NAME(data_out, data_in, is_first_in_pair, idx, length):
    data_out[:] = 0
    for i in numba.prange(length - 1):  # pylint: disable=not-an-iterable
        if is_first_in_pair[i]:
            if data_in[idx[i]] < data_in[idx[i + 1]]:
                data_out[i], data_out[i + 1] = data_in[idx[i + 1]], data_in[idx[i]]
            else:
                data_out[i], data_out[i + 1] = data_in[idx[i]], data_in[idx[i + 1]]