<s> """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> import webapp2 <EOL> import os <EOL> import base64 <EOL> import logging <EOL> import unicodedata <EOL> import json <EOL> from google . appengine . ext . webapp import template <EOL> NORMAL_FORM = '<STR_LIT>' <EOL> def decodeJWTView ( request ) : <EOL> """<STR_LIT>""" <EOL> input_jwt = request . POST . get ( '<STR_LIT>' , None ) <EOL> if not input_jwt : <EOL> webapp2 . abort ( <NUM_LIT> ) <EOL> try : <EOL> input_jwt = unicodedata . normalize ( NORMAL_FORM , input_jwt ) . encode ( <EOL> '<STR_LIT:ascii>' , '<STR_LIT:ignore>' ) <EOL> input_jwt += '<STR_LIT:=>' * ( <NUM_LIT:4> - ( len ( input_jwt ) % <NUM_LIT:4> ) ) <EOL> decoded_jwt = base64 . urlsafe_b64decode ( input_jwt ) <EOL> except JSONDecodeError as e : <EOL> result = { '<STR_LIT:error>' : True } <EOL> webapp2 . abort ( <NUM_LIT> ) <EOL> else : <EOL> decoded_jwt = json . loads ( decoded_jwt ) <EOL> return webapp2 . Response ( json . dumps ( decoded_jwt , indent = <NUM_LIT:8> ) ) <EOL> def displayIndexView ( request ) : <EOL> """<STR_LIT>""" <EOL> path = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) <EOL> template_values = None <EOL> return webapp2 . Response ( template . render ( path , template_values ) ) <EOL> application = webapp2 . WSGIApplication ( [ <EOL> ( '<STR_LIT>' , decodeJWTView ) , <EOL> ( '<STR_LIT:/>' , displayIndexView ) ] ) </s>
