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, 'logging.getLogger', 'logging.getLogger', False, 'import logging\n'), (11, 'seglossbias.engine.load_config', 'load_config', False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTester\n'), (12, 'seglossbias.utils.mkdir', 'mkdir', False, 'from seglossbias.utils import mkdir, setup_logging\n'), (13, 'seglossbias.utils.setup_logging', 'setup_logging', False, 'from seglossbias.utils import mkdir, setup_logging\n'), (22, 'seglossbias.engine.DefaultTester', 'DefaultTester', False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTester\n'), (18, 'seglossbias.engine.default_argument_parser', 'default_argument_parser', False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTester\n')]