<s> from textwrap import dedent <EOL> from flask import abort , redirect , render_template , request , url_for <EOL> from pypi_portal . core import flash <EOL> from pypi_portal . blueprints import examples_alerts <EOL> @ examples_alerts . route ( '<STR_LIT:/>' ) <EOL> def index ( ) : <EOL> return render_template ( '<STR_LIT>' ) <EOL> @ examples_alerts . route ( '<STR_LIT>' ) <EOL> def modal ( ) : <EOL> """<STR_LIT>""" <EOL> message_size = request . args . get ( '<STR_LIT>' ) <EOL> flash_count = request . args . get ( '<STR_LIT>' ) <EOL> flash_type = request . args . get ( '<STR_LIT>' ) <EOL> available_types = [ k for k , v in flash . __dict__ . items ( ) if callable ( v ) ] <EOL> if flash_type not in available_types : <EOL> abort ( <NUM_LIT> ) <EOL> if not str ( flash_count ) . isdigit ( ) or not ( <NUM_LIT:1> <= int ( flash_count ) <= <NUM_LIT:10> ) : <EOL> abort ( <NUM_LIT> ) <EOL> if message_size == '<STR_LIT>' : <EOL> message = dedent ( """<STR_LIT>""" ) <EOL> elif message_size == '<STR_LIT>' : <EOL> message = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> else : <EOL> message = '<STR_LIT>' <EOL> func = getattr ( flash , flash_type ) <EOL> for i in range ( int ( flash_count ) ) : <EOL> func ( message ) <EOL> return redirect ( url_for ( '<STR_LIT>' ) ) </s>
