human
I wrote the below code

    if (method not in ['2-point', '3-point', 'cs']):
        raise ValueError(("Unknown    method    '%s'.    " % method))
    x0 = np.atleast_1d(x0)
    if (x0.ndim > 1):
        raise ValueError('`x0`    must    have    at    most    1    dimension.')
    (lb, ub) = _prepare_bounds(bounds, x0)
    if ((lb.shape != x0.shape) or (ub.shape != x0.shape)):
        raise ValueError('Inconsistent    shapes    between    bounds    and    `x0`.')
    def fun_wrapped(x):
        f = np.atleast_1d(fun(x, *args, **kwargs))
        if (f.ndim > 1):
            raise RuntimeError('`fun`    return    value    has    more    than    1    dimension.')
        return f
    if (f0 is None):
        f0 = fun_wrapped(x0)
    else:
        f0 = np.atleast_1d(f0)
        if (f0.ndim > 1):
            raise ValueError('`f0`    passed    has    more    than    1    dimension.')
    if np.any(((x0 < lb) | (x0 > ub))):
        raise ValueError('`x0`    violates    bound    constraints.')
    h = _compute_absolute_step(rel_step, x0, method)
    if (method == '2-point'):
        (h, use_one_sided) = _adjust_scheme_to_bounds(x0, h, 1, '1-sided', lb, ub)
    elif (method == '3-point'):
        (h, use_one_sided) = _adjust_scheme_to_bounds(x0, h, 1, '2-sided', lb, ub)
    elif (method == 'cs'):
        use_one_sided = False
    if (sparsity is None):
        return _dense_difference(fun_wrapped, x0, f0, h, use_one_sided, method)
    else:
        if ((not issparse(sparsity)) and (len(sparsity) == 2)):
            (structure, groups) = sparsity
        else:
            structure = sparsity
            groups = group_columns(sparsity)
        if issparse(structure):
            structure = csc_matrix(structure)
        else:
            structure = np.atleast_2d(structure)
        groups = np.atleast_1d(groups)
        return _sparse_difference(fun_wrapped, x0, f0, h, use_one_sided, structure, groups, method)

What's a good function header?

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

def approx_derivative(fun, x0, method='3-point', rel_step=None, f0=None, bounds=((- np.inf), np.inf), sparsity=None, args=(), kwargs={}):