Skip to content

Instantly share code, notes, and snippets.

@crankycoder
Created October 30, 2019 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crankycoder/3f933e0048bf7e2e5fec715959f80567 to your computer and use it in GitHub Desktop.
Save crankycoder/3f933e0048bf7e2e5fec715959f80567 to your computer and use it in GitHub Desktop.
MAD Cat
'''
Run this with:
env FLASK_APP=foo.py flask run
.
|'.._ __......._ _.-'.
\M\ ^'.-' ''-/ /
:M'._ ^'\ ;
'MMM'. '
'.MMMM/ ;._ ,,|
\M; . /.#\ /'' |
; /d' #.___./d \ ":
"| '---:dM +\-/ ;
: _.d._'^. \
', / | ; ;
..,___'.._,:\..' \\ ha
'''
from flask import Flask, escape, request
app = Flask(__name__)
@app.route("/v1/api/score_features/<webext_guid>/<scanner_id>/", methods=["POST"])
def score_feature(scanner_id, feature_vector):
pass
model = model_factory(scanner_id)
score = model.compute_score(ffeature_vector)
db.write(score, scanner_id)
return score
# TODO: fill in feature scoring code here
# TODO: write the score for this particular scanner into database/datastore
# TODO return the score for this scanner
@app.route("/v1/api/ensemble_score/<webext_guid>/", methods=['POST'])
def ensemble_score(webext_guid):
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment