<s> """<STR_LIT>""" <EOL> import collections <EOL> import os <EOL> import urllib2 <EOL> _METADATA_BASE_PATH = '<STR_LIT>' <EOL> def _MetadataGetter ( key ) : <EOL> """<STR_LIT>""" <EOL> req = urllib2 . Request ( '<STR_LIT>' % ( _METADATA_BASE_PATH , key ) ) <EOL> req . add_header ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> return urllib2 . urlopen ( req ) . read ( ) <EOL> VmAppengineEnvConfig = collections . namedtuple ( <EOL> '<STR_LIT>' , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> def BuildVmAppengineEnvConfig ( ) : <EOL> """<STR_LIT>""" <EOL> appid = os . environ . get ( '<STR_LIT>' ) <EOL> partition = os . environ . get ( '<STR_LIT>' ) <EOL> module = os . environ . get ( '<STR_LIT>' ) <EOL> major_version = os . environ . get ( '<STR_LIT>' ) <EOL> minor_version = os . environ . get ( '<STR_LIT>' ) <EOL> appengine_hostname = os . environ . get ( '<STR_LIT>' ) <EOL> instance = ( os . environ . get ( '<STR_LIT>' ) or <EOL> _MetadataGetter ( '<STR_LIT>' ) ) <EOL> escaped_appid = appid . replace ( '<STR_LIT::>' , '<STR_LIT:_>' ) . replace ( '<STR_LIT:.>' , '<STR_LIT:_>' ) <EOL> default_ticket = '<STR_LIT>' % ( <EOL> escaped_appid , module , major_version , instance ) <EOL> server_software = os . environ . get ( '<STR_LIT>' ) <EOL> return VmAppengineEnvConfig ( appid = appid , <EOL> partition = partition , <EOL> module = module , <EOL> major_version = major_version , <EOL> minor_version = minor_version , <EOL> instance = instance , <EOL> default_ticket = default_ticket , <EOL> server_software = server_software , <EOL> appengine_hostname = appengine_hostname ) </s>
