def ensure_config_exists(config_dir, detect_location=True):
    config_path = find_config_file(config_dir)

    if config_path is None:
        print("Unable to find configuration. Creating default one in",
              config_dir)
        config_path = create_default_config(config_dir, detect_location)

    return config_path
Ensure a config file exists in given configuration directory.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/config.py/ensure_config_exists