def write_config(config, config_path=CONFIG_PATH):
if not os.path.exists(config_path):<EOL><INDENT>os.makedirs(os.path.dirname(config_path))<EOL><DEDENT>with open(config_path, '<STR_LIT:w>', encoding='<STR_LIT:utf-8>') as f:<EOL><INDENT>config.write(f)<EOL><DEDENT>
Write the config to the output path.
    Creates the necessary directories if they aren't there.

    Args:
        config (configparser.ConfigParser): A ConfigParser.