def save_file(data, export_file):
create_dir(os.path.dirname(export_file))<EOL>try:<EOL><INDENT>with open(export_file, "<STR_LIT:w>") as file:<EOL><INDENT>file.write(data)<EOL><DEDENT><DEDENT>except PermissionError:<EOL><INDENT>logging.warning("<STR_LIT>", export_file)<EOL><DEDENT>
Write data to a file.