<s> from imports import * <EOL> from config import * <EOL> from routes import * <EOL> from handlers import * <EOL> from datetime import timedelta <EOL> class ProfileHandler ( BaseHandler ) : <EOL> def get ( self ) : <EOL> username_session = self . session . get ( '<STR_LIT:username>' ) <EOL> if username_session : <EOL> navdata = db . GqlQuery ( "<STR_LIT>" , u = username_session ) . get ( ) <EOL> len_lang_list = len ( navdata . lang_list ) <EOL> none = "<STR_LIT>" <EOL> lang_list = navdata . lang_list <EOL> fullnam = navdata . fullname <EOL> avatar_url = navdata . avatar_url <EOL> current_url = self . request . url <EOL> username_url = current_url . split ( '<STR_LIT:/>' ) [ <NUM_LIT:4> ] <EOL> isuser = db . GqlQuery ( "<STR_LIT>" , u = username_url ) . fetch ( limit = <NUM_LIT:2> ) <EOL> if len ( isuser ) == <NUM_LIT:0> : <EOL> self . response . out . write ( "<STR_LIT>" ) <EOL> return <EOL> userdata = db . GqlQuery ( "<STR_LIT>" , u = username_url ) <EOL> repodata = db . GqlQuery ( "<STR_LIT>" , u = username_url ) <EOL> noofrepos = repodata . fetch ( limit = <NUM_LIT:2> ) <EOL> self . render ( '<STR_LIT>' , userdata = userdata , repodata = repodata , avatar_url = avatar_url , navfullname = fullnam , noofrepos = noofrepos , navusername = username_session , len_lang_list = len_lang_list , lang_list = lang_list ) <EOL> else : <EOL> current_url = self . request . url <EOL> username_url = current_url . split ( '<STR_LIT:/>' ) [ <NUM_LIT:4> ] <EOL> isuser = db . GqlQuery ( "<STR_LIT>" , u = username_url ) . fetch ( limit = <NUM_LIT:2> ) <EOL> if len ( isuser ) == <NUM_LIT:0> : <EOL> self . response . out . write ( "<STR_LIT>" ) <EOL> return <EOL> userdata = db . GqlQuery ( "<STR_LIT>" , u = username_url ) <EOL> repodata = db . GqlQuery ( "<STR_LIT>" , u = username_url ) <EOL> self . render ( '<STR_LIT>' , userdata = userdata , repodata = repodata , navfullname = "<STR_LIT>" ) </s>
