<s> """<STR_LIT>""" <EOL> from taskmaster . util import parse_options <EOL> from taskmaster . constants import ( DEFAULT_LOG_LEVEL , <EOL> DEFAULT_ADDRESS , DEFAULT_BUFFER_SIZE ) <EOL> def run ( target , kwargs = None , reset = False , size = DEFAULT_BUFFER_SIZE , <EOL> address = DEFAULT_ADDRESS , log_level = DEFAULT_LOG_LEVEL ) : <EOL> from taskmaster . server import Server , Controller <EOL> server = Server ( address , size = size , log_level = log_level ) <EOL> controller = Controller ( server , target , kwargs = kwargs , log_level = log_level ) <EOL> if reset : <EOL> controller . reset ( ) <EOL> controller . start ( ) <EOL> def main ( ) : <EOL> import optparse <EOL> import sys <EOL> parser = optparse . OptionParser ( ) <EOL> parser . add_option ( "<STR_LIT>" , dest = "<STR_LIT:address>" , default = DEFAULT_ADDRESS ) <EOL> parser . add_option ( "<STR_LIT>" , dest = "<STR_LIT:size>" , default = DEFAULT_BUFFER_SIZE , type = int ) <EOL> parser . add_option ( "<STR_LIT>" , dest = "<STR_LIT>" , default = False , action = '<STR_LIT:store_true>' ) <EOL> parser . add_option ( "<STR_LIT>" , dest = "<STR_LIT>" , default = DEFAULT_LOG_LEVEL ) <EOL> ( options , args ) = parser . parse_args ( ) <EOL> if len ( args ) < <NUM_LIT:1> : <EOL> print '<STR_LIT>' <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> sys . exit ( run ( args [ <NUM_LIT:0> ] , parse_options ( args [ <NUM_LIT:1> : ] ) , ** options . __dict__ ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
