@staticmethod<EOL><INDENT>def _compute_timestamp(stupid_cisco_output):<DEDENT>
if not stupid_cisco_output or stupid_cisco_output == '<STR_LIT>':<EOL><INDENT>return -<NUM_LIT:1.0><EOL><DEDENT>if '<STR_LIT>' in stupid_cisco_output:<EOL><INDENT>pass<EOL><DEDENT>elif '<STR_LIT::>' in stupid_cisco_output:<EOL><INDENT>stupid_cisco_output = stupid_cisco_output.replace('<STR_LIT::>', '<STR_LIT>', <NUM_LIT:1>)<EOL>stupid_cisco_output = stupid_cisco_output.replace('<STR_LIT::>', '<STR_LIT>', <NUM_LIT:1>)<EOL>stupid_cisco_output += '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>stupid_cisco_output = stupid_cisco_output.replace('<STR_LIT:d>', '<STR_LIT>')<EOL>stupid_cisco_output = stupid_cisco_output.replace('<STR_LIT:h>', '<STR_LIT>')<EOL><DEDENT>things = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': <NUM_LIT:1><EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': <NUM_LIT><EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': <NUM_LIT><EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': <NUM_LIT> * <NUM_LIT><EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': <NUM_LIT:7> * <NUM_LIT> * <NUM_LIT><EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': <NUM_LIT> * <NUM_LIT> * <NUM_LIT><EOL>}<EOL>}<EOL>things_keys = things.keys()<EOL>for part in stupid_cisco_output.split():<EOL><INDENT>for key in things_keys:<EOL><INDENT>if key in part:<EOL><INDENT>things[key]['<STR_LIT:count>'] = napalm_base.helpers.convert(<EOL>int, part.replace(key, '<STR_LIT>'), <NUM_LIT:0>)<EOL><DEDENT><DEDENT><DEDENT>delta = sum([det.get('<STR_LIT:count>', <NUM_LIT:0>) * det.get('<STR_LIT>') for det in things.values()])<EOL>return time.time() - delta<EOL>
Some fields such `uptime` are returned as: 23week(s) 3day(s)
This method will determine the epoch of the event.
e.g.: 23week(s) 3day(s) -> 1462248287