#NEWLINE# def get_manager( client , hostname = None , port = None , userid = None , password = None ) : #NEWLINE# #INDENT# import pyrabbit #NEWLINE# opt = client . transport_options . get #NEWLINE# def get( name , val , default ) : #NEWLINE# #INDENT# return ( val if ( val is not None ) else ( opt ( ( 'manager_%s' % name ) ) or getattr ( client , name , None ) or default ) ) #NEWLINE# #UNINDENT# host = get ( 'hostname' , hostname , 'localhost' ) #NEWLINE# port = ( port if ( port is not None ) else opt ( 'manager_port' , 15672 ) ) #NEWLINE# userid = get ( 'userid' , userid , 'guest' ) #NEWLINE# password = get ( 'password' , password , 'guest' ) #NEWLINE# return pyrabbit . Client ( ( '%s:%s' % ( host , port ) ) , userid , password )