code: def save_yaml(dictionary, path, pretty=False, sortkeys=False):
      if sortkeys:
          dictionary = dict(dictionary)
      with open(path, 'w') as f:
          if pretty:
              pyaml.dump(dictionary, f)
          else:
              yaml.dump(dictionary, f, default_flow_style=None, Dumper=yamlloader.ordereddict.CDumper)