serve.py
def recommend():
    """ return user's svm sorted list """
    ttstr = request.args.get("timefilter", "week")  # default is week
    vstr = request.args.get("vfilter", "all")  # default is all (no filter)
    legend = {"day": 1, "3days": 3, "week": 7, "month": 30, "year": 365}
    tt = legend.get(ttstr, None)
    papers = papers_from_svm(recent_days=tt)
    papers = papers_filter_version(papers, vstr)
    ctx = default_context(
        papers,
        render_format="recommend",
        msg="Recommended papers: (based on SVM trained on tfidf of papers in your library, refreshed every day or so)"
        if g.user
        else "You must be logged in and have some papers saved in your library.",
    )
    return render_template("main.html", **ctx)
 return user's svm sorted list 
return user's svm sorted list
return user ' s svm sorted list
def recommend():
    ttstr = request.args.get("timefilter", "week")  
    vstr = request.args.get("vfilter", "all")  
    legend = {"day": 1, "3days": 3, "week": 7, "month": 30, "year": 365}
    tt = legend.get(ttstr, None)
    papers = papers_from_svm(recent_days=tt)
    papers = papers_filter_version(papers, vstr)
    ctx = default_context(
        papers,
        render_format="recommend",
        msg="Recommended papers: (based on SVM trained on tfidf of papers in your library, refreshed every day or so)"
        if g.user
        else "You must be logged in and have some papers saved in your library.",
    )
    return render_template("main.html", **ctx)
def recommend ( ) : ttstr = request . args . get ( "timefilter" , "week" ) vstr = request . args . get ( "vfilter" , "all" ) legend = { "day" : 1 , "3days" : 3 , "week" : 7 , "month" : 30 , "year" : 365 } tt = legend . get ( ttstr , None ) papers = papers_from_svm ( recent_days = tt ) papers = papers_filter_version ( papers , vstr ) ctx = default_context ( papers , render_format = "recommend" , msg = "Recommended papers: (based on SVM trained on tfidf of papers in your library, refreshed every day or so)" if g . user else "You must be logged in and have some papers saved in your library." , ) return render_template ( "main.html" , ** ctx )
return user's svm sorted list
return user ' s svm sorted list
""" return user's svm sorted list """ # default is week # default is all (no filter)