#NEWLINE# def __init__( self , base_url , * args , **kwargs ) : #NEWLINE# #INDENT# requests . Session . __init__ ( self , * args , ** kwargs ) #NEWLINE# self . base_url = base_url #NEWLINE# parsed_url = urlparse ( self . base_url ) #NEWLINE# if ( parsed_url . username and parsed_url . password ) : #NEWLINE# #INDENT# netloc = parsed_url . hostname #NEWLINE# if parsed_url . port : #NEWLINE# #INDENT# netloc += ( ':%d' % parsed_url . port ) #NEWLINE# #UNINDENT# self . base_url = urlunparse ( ( parsed_url . scheme , netloc , parsed_url . path , parsed_url . params , parsed_url . query , parsed_url . fragment ) ) #NEWLINE# self . auth = HTTPBasicAuth ( parsed_url . username , parsed_url . password )