Dumps the dictionary as a YAML document :param dict_to_dump: :return:
(dict_to_dump)
| 79 | |
| 80 | |
| 81 | def yaml_dump(dict_to_dump): |
| 82 | """ |
| 83 | Dumps the dictionary as a YAML document |
| 84 | :param dict_to_dump: |
| 85 | :return: |
| 86 | """ |
| 87 | |
| 88 | yaml = ruamel.yaml.YAML(typ="safe", pure=True) |
| 89 | yaml.default_flow_style = False |
| 90 | yaml.Emitter = SafeLineBreakEmitter |
| 91 | yaml.Representer = FlattenAliasRepresenter |
| 92 | _add_yaml_1_1_boolean_resolvers(yaml.Resolver) |
| 93 | yaml.Representer.add_representer(OrderedDict, _dict_representer) |
| 94 | |
| 95 | return dump_yaml_to_str(yaml, dict_to_dump) |
| 96 | |
| 97 | |
| 98 | def _dict_constructor(loader, node): |