def spit_json(request, j, expires=0, raw=False):
    if raw:
        body = j
    else:
        body = json.dumps(j)
    if 'HTTP_USER_AGENT' in request.META:
        if 'curl/' in request.META['HTTP_USER_AGENT']:
            body += '\n'
    response = HttpResponse(body, content_type="application/json")
    if expires > 0:
        response['Expires'] = http_date(time.time() + expires)
    return response
dataset/ETHPy150Open unbit/uwsgi.it/uwsgi_it_api/uwsgi_it_api/utils.py/spit_json/original