<s> """<STR_LIT>""" <EOL> import argparse <EOL> import copy <EOL> class _StoreDictAction ( argparse . Action ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , option_strings , dest , nargs = None , const = None , <EOL> default = None , type = None , choices = None , required = False , <EOL> help = None , metavar = None ) : <EOL> if nargs == <NUM_LIT:0> : <EOL> raise ValueError ( '<STR_LIT>' ) <EOL> if const is not None and nargs != '<STR_LIT:?>' : <EOL> raise ValueError ( '<STR_LIT>' ) <EOL> super ( _StoreDictAction , self ) . __init__ ( option_strings = option_strings , <EOL> dest = dest , <EOL> nargs = nargs , <EOL> const = const , <EOL> default = default , <EOL> type = type , <EOL> choices = choices , <EOL> required = required , <EOL> help = help , <EOL> metavar = metavar ) <EOL> def __call__ ( self , parser , namespace , values , option_string = None ) : <EOL> if getattr ( namespace , self . dest , None ) is None : <EOL> setattr ( namespace , self . dest , { } ) <EOL> items = copy . copy ( getattr ( namespace , self . dest ) ) <EOL> key , val = values . split ( "<STR_LIT:=>" , <NUM_LIT:1> ) <EOL> try : <EOL> val = int ( val ) <EOL> except ValueError : <EOL> try : <EOL> val = float ( val ) <EOL> except ValueError : <EOL> pass <EOL> items [ key ] = val <EOL> setattr ( namespace , self . dest , items ) <EOL> def add_ackers ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> type = int ) <EOL> def add_debug ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , <EOL> action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' ) <EOL> def add_environment ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def add_name ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def add_options ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , <EOL> action = _StoreDictAction , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def add_par ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , <EOL> default = <NUM_LIT:2> , <EOL> type = int , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def add_pattern ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> def add_simple_jar ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , <EOL> action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def add_wait ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( '<STR_LIT>' , <EOL> type = int , <EOL> default = <NUM_LIT:5> , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def add_workers ( parser ) : <EOL> """<STR_LIT>""" <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , <EOL> type = int , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def resolve_ackers_workers ( args ) : <EOL> """<STR_LIT>""" <EOL> if args . ackers is None : <EOL> args . ackers = args . par <EOL> if args . workers is None : <EOL> args . workers = args . par </s>
