human
I wrote the below code

    pairs = {u'FUNCTION': u')', u'(': u')', u'[': u']', u'{': u'}'}
    tokens = iter(tokens)
    eof = [False]
    def _regroup_inner(stop_at=None, tokens=tokens, pairs=pairs, eof=eof, ContainerToken=token_data.ContainerToken, FunctionToken=token_data.FunctionToken):
        for token in tokens:
            type_ = token.type
            if (type_ == stop_at):
                return
            end = pairs.get(type_)
            if (end is None):
                (yield token)
            else:
                assert (not isinstance(token, ContainerToken)), u'Token    looks    already    grouped:    {0}'.format(token)
                content = list(_regroup_inner(end))
                if eof[0]:
                    end = u''
                if (type_ == u'FUNCTION'):
                    (yield FunctionToken(token.type, token.as_css(), end, token.value, content, token.line, token.column))
                else:
                    (yield ContainerToken(token.type, token.as_css(), end, content, token.line, token.column))
        else:
            eof[0] = True
    return _regroup_inner()

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

def regroup(tokens):