def parse_verbose(self, line):
try:<EOL><INDENT>logging.debug(line)<EOL>(host, pings) = line.split('<STR_LIT>')<EOL>cnt = <NUM_LIT:0><EOL>lost = <NUM_LIT:0><EOL>times = []<EOL>pings = pings.strip().split('<STR_LIT:U+0020>')<EOL>cnt = len(pings)<EOL>for latency in pings:<EOL><INDENT>if latency == '<STR_LIT:->':<EOL><INDENT>continue<EOL><DEDENT>times.append(float(latency))<EOL><DEDENT>lost = cnt - len(times)<EOL>if lost:<EOL><INDENT>loss = lost / float(cnt)<EOL><DEDENT>else:<EOL><INDENT>loss = <NUM_LIT:0.0><EOL><DEDENT>rv = {<EOL>'<STR_LIT:host>': host.strip(),<EOL>'<STR_LIT>': cnt,<EOL>'<STR_LIT>': loss,<EOL>'<STR_LIT:data>': times,<EOL>}<EOL>if times:<EOL><INDENT>rv['<STR_LIT>'] = min(times)<EOL>rv['<STR_LIT>'] = max(times)<EOL>rv['<STR_LIT>'] = sum(times) / len(times)<EOL>rv['<STR_LIT>'] = times[-<NUM_LIT:1>]<EOL><DEDENT>return rv<EOL><DEDENT>except Exception as e:<EOL><INDENT>logging.error("<STR_LIT>".format(e))<EOL><DEDENT>
parse output from verbose format