<s> import shared <EOL> import sys <EOL> def convertIntToString ( n ) : <EOL> a = __builtins__ . hex ( n ) <EOL> if a [ - <NUM_LIT:1> : ] == '<STR_LIT:L>' : <EOL> a = a [ : - <NUM_LIT:1> ] <EOL> if ( len ( a ) % <NUM_LIT:2> ) == <NUM_LIT:0> : <EOL> return a [ <NUM_LIT:2> : ] . decode ( '<STR_LIT>' ) <EOL> else : <EOL> return ( '<STR_LIT:0>' + a [ <NUM_LIT:2> : ] ) . decode ( '<STR_LIT>' ) <EOL> def convertStringToInt ( s ) : <EOL> return int ( s . encode ( '<STR_LIT>' ) , <NUM_LIT:16> ) <EOL> def signal_handler ( signal , frame ) : <EOL> if shared . safeConfigGetBoolean ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> shared . doCleanShutdown ( ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> else : <EOL> print '<STR_LIT>' <EOL> def isHostInPrivateIPRange ( host ) : <EOL> if host [ : <NUM_LIT:3> ] == '<STR_LIT>' : <EOL> return True <EOL> if host [ : <NUM_LIT:4> ] == '<STR_LIT>' : <EOL> if host [ <NUM_LIT:6> ] == '<STR_LIT:.>' : <EOL> if int ( host [ <NUM_LIT:4> : <NUM_LIT:6> ] ) >= <NUM_LIT:16> and int ( host [ <NUM_LIT:4> : <NUM_LIT:6> ] ) <= <NUM_LIT> : <EOL> return True <EOL> if host [ : <NUM_LIT:8> ] == '<STR_LIT>' : <EOL> return True <EOL> return False <EOL> def addDataPadding ( data , desiredMsgLength = <NUM_LIT:12> , paddingChar = '<STR_LIT:\x00>' ) : <EOL> return data + paddingChar * ( desiredMsgLength - len ( data ) ) </s>
