<s> from lib . mmonit import MmonitBaseAction <EOL> class MmonitListUptimeHosts ( MmonitBaseAction ) : <EOL> def run ( self , uptime_range = <NUM_LIT:0> , datefrom = <NUM_LIT:0> , dateto = <NUM_LIT:0> ) : <EOL> self . login ( ) <EOL> if datefrom != <NUM_LIT:0> and uptime_range != <NUM_LIT:12> : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> data = { "<STR_LIT>" : uptime_range , "<STR_LIT>" : datefrom , "<STR_LIT>" : dateto } <EOL> req = self . session . post ( "<STR_LIT>" . format ( self . url ) , data = data ) <EOL> try : <EOL> return req . json ( ) <EOL> except Exception : <EOL> raise <EOL> finally : <EOL> self . logout ( ) </s>
