import sys
import logging

from seglossbias.utils import mkdir, setup_logging
from seglossbias.engine import default_argument_parser, load_config, DefaultTester

logger = logging.getLogger(__name__)


def setup(args):
    cfg = load_config(args)
    mkdir(cfg.OUTPUT_DIR)
    setup_logging(output_dir=cfg.OUTPUT_DIR)
    return cfg


def main():
    args = default_argument_parser().parse_args()
    cfg = setup(args)
    logger.info("Launch command : ")
    logger.info(" ".join(sys.argv))
    tester = DefaultTester(cfg)
    tester.test()


if __name__ == "__main__":
    main()

[((7, 9, 7, 36), 'logging.getLogger', 'logging.getLogger', ({(7, 27, 7, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((11, 10, 11, 27), 'seglossbias.engine.load_config', 'load_config', ({(11, 22, 11, 26): 'args'}, {}), '(args)', False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTester\n'), ((12, 4, 12, 25), 'seglossbias.utils.mkdir', 'mkdir', ({(12, 10, 12, 24): 'cfg.OUTPUT_DIR'}, {}), '(cfg.OUTPUT_DIR)', False, 'from seglossbias.utils import mkdir, setup_logging\n'), ((13, 4, 13, 44), 'seglossbias.utils.setup_logging', 'setup_logging', (), '', False, 'from seglossbias.utils import mkdir, setup_logging\n'), ((22, 13, 22, 31), 'seglossbias.engine.DefaultTester', 'DefaultTester', ({(22, 27, 22, 30): 'cfg'}, {}), '(cfg)', False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTester\n'), ((18, 11, 18, 36), 'seglossbias.engine.default_argument_parser', 'default_argument_parser', ({}, {}), '()', False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTester\n')]