def main():
args = get_args()<EOL>log_datafile = args.log_file[<NUM_LIT:0>]<EOL>version = args.version[<NUM_LIT:0>]<EOL>pickle = args.pickle<EOL>verbose = args.verbose<EOL>if pickle:<EOL><INDENT>from sbp.client.loggers.pickle_logger import PickleLogIterator as Iterator<EOL><DEDENT>else:<EOL><INDENT>from sbp.client.loggers.json_logger import JSONLogIterator as Iterator<EOL><DEDENT>if verbose:<EOL><INDENT>assert False, "<STR_LIT>"<EOL><DEDENT>num_test_cases = <NUM_LIT:5><EOL>message_table = _SBP_TABLE<EOL>test_table = dict((k, []) for (k, v) in iter(message_table.copy().items()))<EOL>with Iterator(log_datafile) as log:<EOL><INDENT>for msg, metadata in next(log):<EOL><INDENT>try:<EOL><INDENT>i = mk_readable_msg(msg)<EOL><DEDENT>except TypeError as ex_info:<EOL><INDENT>out = "<STR_LIT>"% (ex_info.message, msg.msg_type)<EOL>warnings.warn(out, RuntimeWarning)<EOL>continue<EOL><DEDENT>name = i['<STR_LIT>']['<STR_LIT:name>']<EOL>if not name in test_table:<EOL><INDENT>test_table[name] = [i];      <EOL><DEDENT>elif len(test_table[name]) < num_test_cases and test_table[name][-<NUM_LIT:1>] != i:<EOL><INDENT>test_table[name].append(i)<EOL><DEDENT><DEDENT><DEDENT>dump_modules_to_yaml(test_table, version)<EOL>
Get command line configuration, read log data, and write out
YAML-formatted unit test data.