human
I wrote the below code

    import warnings
    warnings.warn('Old    ADVI    interface    is    deprecated    and    be    removed    in    future,    use    pm.ADVI    instead', DeprecationWarning, stacklevel=2)
    if (encoder_params is None):
        encoder_params = []
    model = pm.modelcontext(model)
    vars = inputvars((vars if (vars is not None) else model.vars))
    start = (start if (start is not None) else model.test_point)
    if (not pm.model.all_continuous(vars)):
        raise ValueError('Model    can    not    include    discrete    RVs    for    ADVI.')
    _check_minibatches(minibatch_tensors, minibatches)
    if (encoder_params is None):
        encoder_params = []
    if (optimizer is None):
        optimizer = adagrad_optimizer(learning_rate, epsilon)
    (local_RVs, observed_RVs) = _get_rvss(minibatch_RVs, local_RVs, observed_RVs, minibatch_tensors, total_size)
    def get_transformed(v):
        if hasattr(v, 'transformed'):
            return v.transformed
        return v
    local_RVs = OrderedDict([(get_transformed(v), (uw, s)) for (v, (uw, s)) in local_RVs.items()])
    grvs = list((set(vars) - set((list(local_RVs) + list(observed_RVs)))))
    if (global_RVs is None):
        global_RVs = OrderedDict({v: 1 for v in grvs})
    elif (len(grvs) != len(global_RVs)):
        _value_error('global_RVs    ({})    must    have    all    global    RVs:    {}'.format([v for v in global_RVs], grvs))
    (elbo, uw_l, uw_g) = _make_elbo_t(observed_RVs, global_RVs, local_RVs, model.potentials, n_mcsamples, random_seed)
    replaces = dict()
    if (0 < len(global_RVs)):
        (uw_global_shared, bij) = _init_uw_global_shared(start, global_RVs)
        replaces.update({uw_g: uw_global_shared})
    if (0 < len(local_RVs)):
        uws = [uw for (_, (uw, _)) in local_RVs.items()]
        uw_local_encoded = tt.concatenate(([uw[0].ravel() for uw in uws] + [uw[1].ravel() for uw in uws]))
        replaces.update({uw_l: uw_local_encoded})
    elbo = theano.clone(elbo, OrderedDict(replaces), strict=False)
    def...

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

@change_flags(compute_test_value='ignore')
def advi_minibatch(vars=None, start=None, model=None, n=5000, n_mcsamples=1, minibatch_RVs=None, minibatch_tensors=None, minibatches=None, global_RVs=None, local_RVs=None, observed_RVs=None, encoder_params=None, total_size=None, optimizer=None, learning_rate=0.001, epsilon=0.1, random_seed=None, mode=None):