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()

[((171, 198), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (188, 198), False, 'import logging\n'), ((228, 245), 'seglossbias.engine.load_config', 'load_config', (['args'], {}), '(args)\n', (239, 245), False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTester\n'), ((250, 271), 'seglossbias.utils.mkdir', 'mkdir', (['cfg.OUTPUT_DIR'], {}), '(cfg.OUTPUT_DIR)\n', (255, 271), False, 'from seglossbias.utils import mkdir, setup_logging\n'), ((276, 316), 'seglossbias.utils.setup_logging', 'setup_logging', ([], {'output_dir': 'cfg.OUTPUT_DIR'}), '(output_dir=cfg.OUTPUT_DIR)\n', (289, 316), False, 'from seglossbias.utils import mkdir, setup_logging\n'), ((504, 522), 'seglossbias.engine.DefaultTester', 'DefaultTester', (['cfg'], {}), '(cfg)\n', (517, 522), False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTester\n'), ((357, 382), 'seglossbias.engine.default_argument_parser', 'default_argument_parser', ([], {}), '()\n', (380, 382), False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTester\n')]