def METHOD_NAME(options):
    kore = libqtile.backend.get_core(options.backend)
    if not path.isfile(options.configfile):
        try:
            makedirs(path.dirname(options.configfile), exist_ok=True)
            from shutil import copyfile
            default_config_path = path.join(
                path.dirname(__file__), "..", "resources", "default_config.py"
            )
            copyfile(default_config_path, options.configfile)
            logger.info("Copied default_config.py to %s", options.configfile)
        except Exception:
            logger.exception("Failed to copy default_config.py to %s:", options.configfile)
    config = confreader.Config(options.configfile)
    # XXX: the import is here because we need to call init_log
    # before start importing stuff
    from libqtile.core.manager import Qtile
    return Qtile(
        kore,
        config,
        no_spawn=options.no_spawn,
        state=options.state,
        socket_path=options.socket,
    )