<s> from datetime import datetime <EOL> from google . appengine . ext import ndb <EOL> import flask <EOL> import config <EOL> import model <EOL> import util <EOL> from main import app <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def welcome ( ) : <EOL> if util . param ( '<STR_LIT:username>' ) : <EOL> return flask . redirect ( flask . url_for ( '<STR_LIT>' , username = util . param ( '<STR_LIT:username>' ) ) ) <EOL> person_dbs , person_cursor = model . Account . get_dbs ( <EOL> order = '<STR_LIT>' , <EOL> organization = False , <EOL> ) <EOL> organization_dbs , organization_cursor = model . Account . get_dbs ( <EOL> order = '<STR_LIT>' , <EOL> organization = True , <EOL> ) <EOL> repo_dbs , repo_cursor = model . Repo . get_dbs ( <EOL> order = '<STR_LIT>' , <EOL> ) <EOL> return flask . render_template ( <EOL> '<STR_LIT>' , <EOL> html_class = '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> person_dbs = person_dbs , <EOL> organization_dbs = organization_dbs , <EOL> repo_dbs = repo_dbs , <EOL> ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def new_accounts ( ) : <EOL> person_dbs , person_cursor = model . Account . get_dbs ( <EOL> order = '<STR_LIT>' , <EOL> limit = <NUM_LIT> , <EOL> ) <EOL> return flask . make_response ( flask . render_template ( <EOL> '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> html_class = '<STR_LIT>' , <EOL> person_dbs = person_dbs , <EOL> ) ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def person ( ) : <EOL> limit = int ( util . param ( '<STR_LIT>' , int ) or flask . request . cookies . get ( '<STR_LIT>' ) or config . MAX_DB_LIMIT ) <EOL> order = util . param ( '<STR_LIT>' ) or '<STR_LIT>' <EOL> if '<STR_LIT>' in order : <EOL> order = '<STR_LIT>' <EOL> elif '<STR_LIT>' in order : <EOL> order = '<STR_LIT>' <EOL> person_dbs , person_cursor = model . Account . get_dbs ( <EOL> order = order , <EOL> organization = False , <EOL> limit = limit , <EOL> ) <EOL> response = flask . make_response ( flask . render_template ( <EOL> '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> html_class = '<STR_LIT>' , <EOL> person_dbs = person_dbs , <EOL> order = order , <EOL> limit = limit , <EOL> ) ) <EOL> response . set_cookie ( '<STR_LIT>' , str ( limit ) ) <EOL> return response <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def organization ( ) : <EOL> limit = int ( util . param ( '<STR_LIT>' , int ) or flask . request . cookies . get ( '<STR_LIT>' ) or config . MAX_DB_LIMIT ) <EOL> order = util . param ( '<STR_LIT>' ) or '<STR_LIT>' <EOL> if '<STR_LIT>' in order : <EOL> order = '<STR_LIT>' <EOL> organization_dbs , organization_cursor = model . Account . get_dbs ( <EOL> order = order , <EOL> organization = True , <EOL> limit = limit , <EOL> ) <EOL> response = flask . make_response ( flask . render_template ( <EOL> '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> html_class = '<STR_LIT>' , <EOL> organization_dbs = organization_dbs , <EOL> order = order , <EOL> limit = limit , <EOL> ) ) <EOL> response . set_cookie ( '<STR_LIT>' , str ( limit ) ) <EOL> return response <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def repo ( ) : <EOL> limit = int ( util . param ( '<STR_LIT>' , int ) or flask . request . cookies . get ( '<STR_LIT>' ) or config . MAX_DB_LIMIT ) <EOL> order = util . param ( '<STR_LIT>' ) or '<STR_LIT>' <EOL> if '<STR_LIT>' in order : <EOL> order = '<STR_LIT>' <EOL> repo_dbs , repo_cursor = model . Repo . get_dbs ( <EOL> order = order , <EOL> limit = limit , <EOL> ) <EOL> response = flask . make_response ( flask . render_template ( <EOL> '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> html_class = '<STR_LIT>' , <EOL> repo_dbs = repo_dbs , <EOL> order = order . replace ( '<STR_LIT:->' , '<STR_LIT>' ) , <EOL> limit = limit , <EOL> ) ) <EOL> response . set_cookie ( '<STR_LIT>' , str ( limit ) ) <EOL> return response <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def sitemap ( ) : <EOL> response = flask . make_response ( flask . render_template ( <EOL> '<STR_LIT>' , <EOL> lastmod = config . CURRENT_VERSION_DATE . strftime ( '<STR_LIT>' ) , <EOL> ) ) <EOL> response . headers [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> return response <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def warmup ( ) : <EOL> return '<STR_LIT:success>' </s>
