#NEWLINE# def __init__( self , api_key , url = GCM_URL , proxy = None ) : #NEWLINE# #INDENT# ' api_key : google api key\n            url: url of gcm service.\n            proxy: can be string "http://host:port" or dict {\'https\':\'host:port\'}\n        ' #NEWLINE# self . api_key = api_key #NEWLINE# self . url = url #NEWLINE# if proxy : #NEWLINE# #INDENT# if isinstance ( proxy , basestring ) : #NEWLINE# #INDENT# protocol = url . split ( ':' ) [ 0 ] #NEWLINE# proxy = { #NEWLINE# #INDENT# protocol : proxy , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# auth = urllib2 . HTTPBasicAuthHandler ( ) #NEWLINE# opener = urllib2 . build_opener ( urllib2 . ProxyHandler ( proxy ) , auth , urllib2 . HTTPHandler ) #NEWLINE# urllib2 . install_opener ( opener )