from flask import Response, render_template, jsonify, request, redirect as flask_redirect

def redirect(url=None):
    url = url or request.args.get('referer', '/')
    return flask_redirect(url)

def json(data):
    return jsonify(data)

def response_text(data):
    return data

def render(template, **options):
    return render_template(template, **options)

def response_xml(data):
    return data

def paginate(paginator):
    return json({
            'data': paginator.items, 
            'paginate': {
                'current_page': paginator.page,
                'next': paginator.next_num,
                'prev': paginator.prev_num,
                'total': paginator.total,
                'total_pages': paginator.pages,
                'items': paginator.per_page,
                }
    })

def exception(e):
    r = json({
            'message': e.message,
            'code': e.status_code
        })
    r.status_code = e.status_code
    return r

7eb9d690c0d0c3b1aa709de4a36b3608c31755fe
<mask token>


def redirect(url=None):
    url = url or request.args.get('referer', '/')
    return flask_redirect(url)


<mask token>


def response_text(data):
    return data


def render(template, **options):
    return render_template(template, **options)


def response_xml(data):
    return data


<mask token>


def exception(e):
    r = json({'message': e.message, 'code': e.status_code})
    r.status_code = e.status_code
    return r

<mask token>


def redirect(url=None):
    url = url or request.args.get('referer', '/')
    return flask_redirect(url)


<mask token>


def response_text(data):
    return data


def render(template, **options):
    return render_template(template, **options)


def response_xml(data):
    return data


def paginate(paginator):
    return json({'data': paginator.items, 'paginate': {'current_page':
        paginator.page, 'next': paginator.next_num, 'prev': paginator.
        prev_num, 'total': paginator.total, 'total_pages': paginator.pages,
        'items': paginator.per_page}})


def exception(e):
    r = json({'message': e.message, 'code': e.status_code})
    r.status_code = e.status_code
    return r

<mask token>


def redirect(url=None):
    url = url or request.args.get('referer', '/')
    return flask_redirect(url)


def json(data):
    return jsonify(data)


def response_text(data):
    return data


def render(template, **options):
    return render_template(template, **options)


def response_xml(data):
    return data


def paginate(paginator):
    return json({'data': paginator.items, 'paginate': {'current_page':
        paginator.page, 'next': paginator.next_num, 'prev': paginator.
        prev_num, 'total': paginator.total, 'total_pages': paginator.pages,
        'items': paginator.per_page}})


def exception(e):
    r = json({'message': e.message, 'code': e.status_code})
    r.status_code = e.status_code
    return r

from flask import Response, render_template, jsonify, request, redirect as flask_redirect


def redirect(url=None):
    url = url or request.args.get('referer', '/')
    return flask_redirect(url)


def json(data):
    return jsonify(data)


def response_text(data):
    return data


def render(template, **options):
    return render_template(template, **options)


def response_xml(data):
    return data


def paginate(paginator):
    return json({'data': paginator.items, 'paginate': {'current_page':
        paginator.page, 'next': paginator.next_num, 'prev': paginator.
        prev_num, 'total': paginator.total, 'total_pages': paginator.pages,
        'items': paginator.per_page}})


def exception(e):
    r = json({'message': e.message, 'code': e.status_code})
    r.status_code = e.status_code
    return r

from flask import Response, render_template, jsonify, request, redirect as flask_redirect

def redirect(url=None):
    url = url or request.args.get('referer', '/')
    return flask_redirect(url)

def json(data):
    return jsonify(data)

def response_text(data):
    return data

def render(template, **options):
    return render_template(template, **options)

def response_xml(data):
    return data

def paginate(paginator):
    return json({
            'data': paginator.items, 
            'paginate': {
                'current_page': paginator.page,
                'next': paginator.next_num,
                'prev': paginator.prev_num,
                'total': paginator.total,
                'total_pages': paginator.pages,
                'items': paginator.per_page,
                }
    })

def exception(e):
    r = json({
            'message': e.message,
            'code': e.status_code
        })
    r.status_code = e.status_code
    return r
