

def respond(request, data, code=200):
    data = json.dumps(data, default=stats.json_encoder)
    if ('callback' in request.args):
        request.setResponseCode(200)
        request.setHeader('Content-Type', 'application/javascript')
        return (((request.args['callback'][0] + '(') + data) + ')\n')
    else:
        request.setResponseCode(code)
        request.setHeader('Content-Type', 'application/json')
        return (request + '\n')

dataset/ETHPy150Open wadey/python-ostrich/ostrich/twisted/__init__.py respond/VarMisuse@104/137 `data`->`request`