<s> def reporting ( conn , result , timeout = None ) : <EOL> timeout = timeout or conn . global_timeout <EOL> log_map = { <EOL> '<STR_LIT>' : conn . logger . debug , <EOL> '<STR_LIT:error>' : conn . logger . error , <EOL> '<STR_LIT>' : conn . logger . warning <EOL> } <EOL> while True : <EOL> try : <EOL> received = result . receive ( timeout ) <EOL> level_received , message = list ( received . items ( ) ) [ <NUM_LIT:0> ] <EOL> log_map [ level_received ] ( message . strip ( '<STR_LIT:\n>' ) ) <EOL> except EOFError : <EOL> break <EOL> except Exception as err : <EOL> if err . __class__ . __name__ == '<STR_LIT>' : <EOL> msg = '<STR_LIT>' % timeout <EOL> conn . logger . warning ( msg ) <EOL> break <EOL> raise </s>
