'Get status tasks'

@etag
@api.response(200, model=task_status_list)
def get(self, session=None):

    args = tasks_parser.parse_args()
    page = args[u'page']
    per_page = args[u'per_page']
    sort_by = args[u'sort_by']
    sort_order = args[u'order']
    include_execution = args.get(u'include_execution')
    if (per_page > 100):
        log.debug(u'per_page    is    higher    than    max    value    of    100,    setting    100')
        per_page = 100
    start = (per_page * (page - 1))
    stop = (start + per_page)
    descending = (sort_order == u'desc')
    kwargs = {u'start': start, u'stop': stop, u'order_by': sort_by, u'descending': descending, u'session': session}
    total_items = session.query(StatusTask).count()
    log.debug(u'db    has    a    total    of    %s    status    tasks', total_items)
    if (not total_items):
        return jsonify([])
    db_status_tasks = get_status_tasks(**kwargs)
    total_pages = int(ceil((total_items / float(per_page))))
    if (page > total_pages):
        raise NotFoundError((u'page    %s    does    not    exist' % page))
    actual_size = min(len(db_status_tasks), per_page)
    pagination = pagination_headers(total_pages, total_items, actual_size, request)
    status_tasks = []
    for task in db_status_tasks:
        st_task = task.to_dict()
        if include_execution:
            execution = task.executions.order_by(TaskExecution.start.desc()).first()
            st_task[u'last_execution'] = (execution.to_dict() if execution else {})
        status_tasks.append(st_task)
    rsp = jsonify(status_tasks)
    rsp.headers.extend(pagination)
    return rsp
