예제 #1
0
    def _do_result(self):
        try:
            data = self.rfile.read(int(self.headers["Content-Length"]))
            result = common.decode(data)
            result.save()
            _log_completed(result.spec_uuid)

            self.send_response(200)
            self.send_header("Content-type", "text/plain")
            self.end_headers()
        except:
            self.send_response(404)
            self.end_headers()
예제 #2
0
def compute(spec_data):
    spec = common.decode(spec_data)
    result = models.compute_probabilistic(spec)
    return common.encode(result)