#NEWLINE# def __init__( self , proxies = None ) : #NEWLINE# #INDENT# if ( proxies is None ) : #NEWLINE# #INDENT# proxies = getproxies ( ) #NEWLINE# #UNINDENT# assert hasattr ( proxies , 'has_key' ) , 'proxies must be a mapping' #NEWLINE# self . proxies = proxies #NEWLINE# for ( type , url ) in proxies . items ( ) : #NEWLINE# #INDENT# setattr ( url , ( '%s_open' % type ) , ( lambda r , proxy = url , type = type , meth = self . proxy_open : meth ( r , proxy , type ) ) )