<s> import urllib <EOL> import urllib2 <EOL> class GoogleLoginTokenFactory ( ) : <EOL> _token = None <EOL> def __init__ ( self ) : <EOL> self . url = '<STR_LIT>' <EOL> self . accountType = '<STR_LIT>' <EOL> self . email = '<STR_LIT>' <EOL> self . password = '<STR_LIT>' <EOL> self . source = '<STR_LIT>' <EOL> self . service = '<STR_LIT>' <EOL> def getToken ( self ) : <EOL> if self . _token is None : <EOL> values = { '<STR_LIT>' : self . accountType , <EOL> '<STR_LIT>' : self . email , <EOL> '<STR_LIT>' : self . password , <EOL> '<STR_LIT:source>' : self . source , <EOL> '<STR_LIT>' : self . service } <EOL> data = urllib . urlencode ( values ) <EOL> request = urllib2 . Request ( self . url , data ) <EOL> response = urllib2 . urlopen ( request ) <EOL> responseAsString = response . read ( ) <EOL> responseAsList = responseAsString . split ( '<STR_LIT:\n>' ) <EOL> self . _token = responseAsList [ <NUM_LIT:2> ] . split ( '<STR_LIT:=>' ) [ <NUM_LIT:1> ] <EOL> return self . _token </s>
