human
I wrote the below code

    def is_outputs(elem):
        if (isinstance(elem, (list, tuple)) and all([isinstance(x, theano.Variable) for x in elem])):
            return True
        if isinstance(elem, theano.Variable):
            return True
        return False
    def is_updates(elem):
        if isinstance(elem, dict):
            if ((not isinstance(elem, compat.OrderedDict)) and (len(elem) > 1)):
                warnings.warn((('Expected    OrderedDict    or    OrderedUpdates,    got    ' + str(type(elem))) + '.    This    can    make    your    script    non-deterministic.'))
            return True
        if (isinstance(elem, (list, tuple)) and all([(isinstance(x, (list, tuple)) and (len(x) == 2)) for x in elem])):
            return True
        return False
    def is_condition(elem):
        return isinstance(elem, theano.scan_module.until)
    def _list(x):
        if isinstance(x, (list, tuple)):
            return list(x)
        else:
            return [x]
    def _filter(x):
        '\n                                Ensure    `x`    is    made    only    of    allowed    data    types.\n\n                                Return    True    iff    `x`    is    made    only    of    lists,    tuples,    dictionaries,    Theano\n                                variables    or    `theano.scan_module.until`    objects.\n\n                                '
        iter_on = None
        if (isinstance(x, list) or isinstance(x, tuple)):
            iter_on = x
        elif isinstance(x, dict):
            iter_on = iteritems(x)
        if (iter_on is not None):
            return all((_filter(y) for y in iter_on))
        else:
            return (isinstance(x, theano.Variable) or isinstance(x, theano.scan_module.until))
    if (not _filter(ls)):
        raise ValueError('The    return    value    of    your    scan    lambda    expression    may    only    be    made    of    lists,    tuples,    or    dictionaries    containing    Theano    variables    (or    `theano.scan_module.until`    objects    for   ...

What's a good function header?

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

def get_updates_and_outputs(ls):