def METHOD_NAME(
    shape,
    axis,
    argsort,
    datatype,
    lower,
    upper,
    perform_check,
    timing,
    package,
):
    num.random.seed(42)
    newtype = np.dtype(datatype).type
    N = 1
    for e in shape:
        N *= e
    shape = tuple(shape)
    if np.issubdtype(newtype, np.integer):
        if lower is None:
            lower = np.iinfo(newtype).min
        if upper is None:
            upper = np.iinfo(newtype).max
        a = num.random.randint(low=lower, high=upper, size=N).astype(newtype)
        a = a.reshape(shape)
    elif np.issubdtype(newtype, np.floating):
        a = num.random.random(shape).astype(newtype)
    elif np.issubdtype(newtype, np.complexfloating):
        a = num.array(
            num.random.random(shape) + num.random.random(shape) * 1j
        ).astype(newtype)
    else:
        print("UNKNOWN type " + str(newtype))
        assert False
    timer.start()
    if argsort:
        a_sorted = num.argsort(a, axis)
    else:
        a_sorted = num.sort(a, axis)
    total = timer.stop()
    if perform_check and not argsort:
        check_sorted(a, a_sorted, package, axis)
    else:
        # do we need to synchronize?
        assert True
    if timing:
        print("Elapsed Time: " + str(total) + " ms")
    return total