@app.template_filter('split_chunk')
def split_chunk(list, size):
    return [list[i:(i + size)] for i in range(len(list))[::size]]
@app.template_filter('split_chunk')
def split_chunk(list, size):
    return [list[i:(i + size)] for i in range(len(list))[::size]]