<s> from flask import Flask , render_template <EOL> from flask . ext . navigation import Navigation <EOL> app = Flask ( ) <EOL> nav = Navigation ( app ) <EOL> navbar = nav . Bar ( '<STR_LIT>' , [ <EOL> nav . Item ( u'<STR_LIT>' , endpoint = '<STR_LIT>' ) , <EOL> nav . Item ( u'<STR_LIT>' , endpoint = '<STR_LIT>' , args = lambda : { '<STR_LIT>' : <NUM_LIT:1> } ) , <EOL> nav . Item ( u'<STR_LIT>' , endpoint = '<STR_LIT>' , url = '<STR_LIT>' ) , <EOL> ] ) <EOL> @ navbar . initializer <EOL> def init_navbar ( nav ) : <EOL> def yield_items ( ) : <EOL> for i in range ( <NUM_LIT:2> ) : <EOL> external_url = '<STR_LIT>' % i <EOL> yield nav . Item ( '<STR_LIT>' % i , endpoint = '<STR_LIT>' , url = external_url ) <EOL> nav [ '<STR_LIT>' ] . extend ( yield_items ( ) , after_endpoint = '<STR_LIT>' ) <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def home ( ) : <EOL> return render_template ( '<STR_LIT>' ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def article ( aid ) : <EOL> return render_template ( '<STR_LIT>' , aid = aid ) </s>
