<s> from __future__ import unicode_literals , absolute_import , division <EOL> from flask . ext import script <EOL> from werkzeug . serving import run_simple <EOL> class Server ( script . Server ) : <EOL> name = '<STR_LIT>' <EOL> option_list = script . Server . option_list + ( <EOL> script . Option ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT>' , <EOL> action = '<STR_LIT:store>' , required = False , default = "<STR_LIT>" ) , <EOL> ) <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> kwargs . setdefault ( '<STR_LIT:port>' , None ) <EOL> kwargs . setdefault ( '<STR_LIT:host>' , None ) <EOL> kwargs . setdefault ( '<STR_LIT>' , None ) <EOL> kwargs . setdefault ( '<STR_LIT>' , None ) <EOL> kwargs . setdefault ( '<STR_LIT>' , None ) <EOL> kwargs . setdefault ( '<STR_LIT>' , None ) <EOL> super ( Server , self ) . __init__ ( * args , ** kwargs ) <EOL> def __call__ ( self , app , ** kwargs ) : <EOL> config = app . config <EOL> kwargs = { k : v for k , v in kwargs . items ( ) if v is not None } <EOL> kwargs . setdefault ( '<STR_LIT:host>' , config . get ( '<STR_LIT>' , "<STR_LIT:127.0.0.1>" ) ) <EOL> kwargs . setdefault ( '<STR_LIT:port>' , config . get ( '<STR_LIT>' , <NUM_LIT> ) ) <EOL> kwargs . setdefault ( '<STR_LIT>' , config . get ( '<STR_LIT>' ) ) <EOL> kwargs . setdefault ( '<STR_LIT>' , config . get ( '<STR_LIT>' ) ) <EOL> kwargs . setdefault ( '<STR_LIT>' , config . get ( '<STR_LIT>' ) ) <EOL> kwargs . setdefault ( '<STR_LIT>' , config . get ( '<STR_LIT>' , <NUM_LIT:1> ) ) <EOL> mode = kwargs . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> if mode == "<STR_LIT>" : <EOL> processes = kwargs [ "<STR_LIT>" ] <EOL> run_simple ( kwargs [ "<STR_LIT:host>" ] , <EOL> kwargs [ "<STR_LIT:port>" ] , <EOL> app , <EOL> use_debugger = kwargs [ "<STR_LIT>" ] , <EOL> use_reloader = kwargs [ "<STR_LIT>" ] , <EOL> threaded = kwargs [ "<STR_LIT>" ] , <EOL> processes = ( False if processes == <NUM_LIT:1> else processes ) ) </s>
