def main():
arguments = docopt.docopt(__doc__, version=__version__)<EOL>colorlogs()<EOL>wrapper = BMIWrapper(<EOL>engine=arguments['<STR_LIT>'],<EOL>configfile=arguments['<STR_LIT>'] or '<STR_LIT>'<EOL>)<EOL>if not arguments['<STR_LIT>']:<EOL><INDENT>logging.root.setLevel(logging.DEBUG)<EOL>wrapper.set_logger(logging.root)<EOL><DEDENT>with wrapper as model:<EOL><INDENT>def handler(signum, frame):<EOL><INDENT>"""<STR_LIT>"""<EOL>t_start = model.get_start_time()<EOL>t_end = model.get_end_time()<EOL>t_current = model.get_current_time()<EOL>total = (t_end - t_start)<EOL>now = (t_current - t_start)<EOL>if total > <NUM_LIT:0>:<EOL><INDENT>logging.info("<STR_LIT>", <NUM_LIT> * now / total)<EOL><DEDENT>else:<EOL><INDENT>logging.info("<STR_LIT>")<EOL><DEDENT><DEDENT>if hasattr(signal, '<STR_LIT>'):<EOL><INDENT>signal.signal(signal.SIGINFO, handler)<EOL><DEDENT>if arguments['<STR_LIT>']:<EOL><INDENT>logging.info("<STR_LIT:%s>", trace(model))<EOL><DEDENT>t_end = model.get_end_time()<EOL>t = model.get_start_time()<EOL>while t < t_end:<EOL><INDENT>model.update(-<NUM_LIT:1>)<EOL>t = model.get_current_time()<EOL><DEDENT>if arguments['<STR_LIT>']:<EOL><INDENT>logging.info("<STR_LIT:%s>", trace(model))<EOL><DEDENT><DEDENT>
main bmi runner program