<s> r'''<STR_LIT>''' <EOL> import struct <EOL> from nogotofail . mitm . util import Constants <EOL> level_names = { <EOL> <NUM_LIT:1> : "<STR_LIT>" , <EOL> <NUM_LIT:2> : "<STR_LIT>" , <EOL> } <EOL> description_names = { <EOL> <NUM_LIT:0> : "<STR_LIT>" , <EOL> <NUM_LIT:10> : "<STR_LIT>" , <EOL> <NUM_LIT:20> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT:30> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT:50> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT:100> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> <NUM_LIT> : "<STR_LIT>" , <EOL> } <EOL> class Alert ( object ) : <EOL> class DESCRIPTION ( Constants ) : <EOL> _constants = Constants . constants ( <EOL> { name . upper ( ) : value for value , name in description_names . items ( ) } ) <EOL> class LEVEL ( Constants ) : <EOL> _constants = Constants . constants ( <EOL> { name . upper ( ) : value for value , name in level_names . items ( ) } ) <EOL> def __init__ ( self , level , description ) : <EOL> self . level = level <EOL> self . description = description <EOL> @ staticmethod <EOL> def from_stream ( body ) : <EOL> level , description = struct . unpack_from ( "<STR_LIT>" , body , <NUM_LIT:0> ) <EOL> return Alert ( level , description ) , <NUM_LIT:2> <EOL> def to_bytes ( self ) : <EOL> return struct . pack ( "<STR_LIT>" , self . level , self . description ) <EOL> def __str__ ( self ) : <EOL> return ( "<STR_LIT>" <EOL> % ( level_names . get ( self . level ) , self . level , <EOL> description_names . get ( self . description ) , self . description ) ) </s>
