human
I wrote the below code

    if (a.ndim > 2):
        raise ValueError('argmaxrnd    only    accepts    arrays    of    up    to    2    dim')
    def rndc(x):
        return random.choice((x == bn.nanmax(x)).nonzero()[0])
    random = (np.random if (random_seed is None) else np.random.RandomState(random_seed))
    return (rndc(a) if (a.ndim == 1) else np.apply_along_axis(rndc, axis=1, arr=a))

What's a good function header?

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

def argmaxrnd(a, random_seed=None):