def safe_dump(data, **kwargs): kwargs["default_flow_style"] = False return yaml.dump_all( [data], None, Dumper=PrettyPrinterDumper, **kwargs)