<s> import dshell <EOL> class DshellDecoder ( dshell . TCPDecoder ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self ) : <EOL> dshell . TCPDecoder . __init__ ( self , <EOL> name = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> longdescription = """<STR_LIT>""" , <EOL> filter = "<STR_LIT>" , <EOL> author = '<STR_LIT>' , <EOL> optiondict = { <EOL> '<STR_LIT>' : { '<STR_LIT:type>' : '<STR_LIT:float>' , '<STR_LIT:default>' : <NUM_LIT> , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { '<STR_LIT:type>' : '<STR_LIT:int>' , '<STR_LIT:default>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : { '<STR_LIT:action>' : '<STR_LIT:store_true>' , '<STR_LIT:default>' : False , '<STR_LIT>' : '<STR_LIT>' } , <EOL> } <EOL> ) <EOL> def preModule ( self ) : <EOL> if self . threshold < <NUM_LIT:0> : <EOL> self . warn ( <EOL> "<STR_LIT>" . format ( self . threshold ) ) <EOL> self . threshold = <NUM_LIT> <EOL> elif not self . threshold : <EOL> self . warn ( <EOL> "<STR_LIT>" . format % ( self . threshold ) ) <EOL> def connectionHandler ( self , conn ) : <EOL> if conn . clientbytes < self . minimum : <EOL> return <EOL> if self . zero or ( conn . serverbytes and float ( conn . clientbytes ) / conn . serverbytes > self . threshold ) : <EOL> self . alert ( '<STR_LIT>' . format ( conn . clientbytes / float ( conn . serverbytes ) ) , ** conn . info ( ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> dObj = DshellDecoder ( ) <EOL> print dObj <EOL> else : <EOL> dObj = DshellDecoder ( ) </s>
