<s> from google . appengine . api import apiproxy_stub_map <EOL> from google . appengine . api . app_identity import get_application_id <EOL> import os <EOL> have_appserver = bool ( apiproxy_stub_map . apiproxy . GetStub ( '<STR_LIT>' ) ) <EOL> if have_appserver : <EOL> appid = get_application_id ( ) <EOL> else : <EOL> try : <EOL> from google . appengine . tools import dev_appserver <EOL> from . boot import PROJECT_DIR <EOL> appconfig = dev_appserver . LoadAppConfig ( PROJECT_DIR , { } , <EOL> default_partition = '<STR_LIT>' ) [ <NUM_LIT:0> ] <EOL> appid = appconfig . application . split ( '<STR_LIT>' , <NUM_LIT:1> ) [ - <NUM_LIT:1> ] <EOL> except ImportError , e : <EOL> raise Exception ( '<STR_LIT>' <EOL> '<STR_LIT>' % e ) <EOL> on_production_server = have_appserver and not os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) . lower ( ) . startswith ( '<STR_LIT>' ) </s>
