human
I wrote the below code

    def wrap_into_list(x):
        '\n                                Wrap    the    input    into    a    list    if    it    is    not    already    a    list.\n\n                                '
        if (x is None):
            return []
        elif (not isinstance(x, (list, tuple))):
            return [x]
        else:
            return list(x)
    seqs = wrap_into_list(sequences)
    outs_info = wrap_into_list(outputs_info)
    non_seqs = []
    for elem in wrap_into_list(non_sequences):
        if (not isinstance(elem, gof.Variable)):
            non_seqs.append(tensor.as_tensor_variable(elem))
        else:
            non_seqs.append(elem)
    n_fixed_steps = None
    if isinstance(n_steps, (float, integer_types)):
        n_fixed_steps = int(n_steps)
    else:
        try:
            n_fixed_steps = opt.get_scalar_constant_value(n_steps)
        except tensor.basic.NotScalarConstantError:
            n_fixed_steps = None
    if (hasattr(n_steps, 'dtype') and (str(n_steps.dtype) not in tensor.integer_dtypes)):
        raise ValueError(('    n_steps    must    be    an    int.    dtype    provided    is    %s' % n_steps.dtype))
    n_seqs = len(seqs)
    n_outs = len(outs_info)
    return_steps = OrderedDict()
    for i in xrange(n_seqs):
        if (not isinstance(seqs[i], dict)):
            seqs[i] = OrderedDict([('input', seqs[i]), ('taps', [0])])
        elif (seqs[i].get('taps', None) is not None):
            seqs[i]['taps'] = wrap_into_list(seqs[i]['taps'])
        elif (seqs[i].get('taps', None) is None):
            seqs[i]['taps'] = [0]
    for i in xrange(n_outs):
        if (outs_info[i] is not None):
            if isinstance(outs_info[i], dict):
                if (outs_info[i].get('return_steps', None) is not None):
                    raise ValueError('Using    `return_steps`    has    been    deprecated.    Simply    select    the    entries    you    need    using    a    subtensor.    Scan    will    optimize    memory    consumption,    so    do    not    worry    about   ...

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

def scan(fn, sequences=None, outputs_info=None, non_sequences=None, n_steps=None, truncate_gradient=(-1), go_backwards=False, mode=None, name=None, profile=False, allow_gc=None, strict=False, return_list=False):