human
I wrote the below code

    omitNone = False
    if (NoneIsLast is None):
        NoneIsLast = True
        omitNone = True
    n = len(x)
    ix = range(n)
    if (None not in x):
        ix.sort(reverse=decreasing, key=(lambda j: x[j]))
    else:
        def key(i, x=x):
            elem = x[i]
            if (decreasing == NoneIsLast):
                return ((not (elem is None)), elem)
            else:
                return ((elem is None), elem)
        ix = range(n)
        ix.sort(key=key, reverse=decreasing)
    if omitNone:
        n = len(x)
        for i in range((n - 1), (-1), (-1)):
            if (x[ix[i]] is None):
                n -= 1
        return ix[:n]
    return ix

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def order(x, NoneIsLast=True, decreasing=False):