<s> from __future__ import absolute_import <EOL> class Problem ( object ) : <EOL> SEVERITY_CRITICAL = '<STR_LIT>' <EOL> SEVERITY_WARNING = '<STR_LIT>' <EOL> SEVERITY_LEVELS = { <EOL> SEVERITY_CRITICAL : <NUM_LIT:2> , <EOL> SEVERITY_WARNING : <NUM_LIT:1> , <EOL> } <EOL> def __init__ ( self , message , severity = SEVERITY_CRITICAL , url = None ) : <EOL> assert severity in self . SEVERITY_LEVELS <EOL> self . message = unicode ( message ) <EOL> self . severity = severity <EOL> self . url = url <EOL> def __cmp__ ( self , other ) : <EOL> if not isinstance ( other , Problem ) : <EOL> return NotImplemented <EOL> return cmp ( <EOL> self . SEVERITY_LEVELS [ self . severity ] , <EOL> self . SEVERITY_LEVELS [ other . severity ] , <EOL> ) <EOL> def __str__ ( self ) : <EOL> return self . message . encode ( '<STR_LIT:utf-8>' ) <EOL> def __unicode__ ( self ) : <EOL> return self . message <EOL> @ classmethod <EOL> def threshold ( cls , severity ) : <EOL> threshold = cls . SEVERITY_LEVELS [ severity ] <EOL> def predicate ( problem ) : <EOL> return cls . SEVERITY_LEVELS [ problem . severity ] >= threshold <EOL> return predicate <EOL> class StatusCheck ( object ) : <EOL> def check ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError </s>
