@environmentfilter
def do_groupby(environment, value, attribute):
    expr = make_attrgetter(environment, attribute)
    return sorted(map(_GroupTuple, groupby(sorted(value, key=expr), expr)))
Group a sequence of objects by a common attribute.
dataset/ETHPy150Open GoogleCloudPlatform/appengine-flask-skeleton/lib/jinja2/filters.py/do_groupby