def write_yaml()

in src/utils/io.py [0:0]


def write_yaml(p, data, **kwargs):
    sort_keys = kwargs.get('sort_keys', False)
    indent = kwargs.get('indent', 2)
    default_flow_style = kwargs.get('default_flow_style', False)
    allow_unicode = kwargs.get('allow_unicode', True)
    content = yaml.safe_dump(data, 
                             sort_keys=sort_keys, 
                             indent=indent,
                             default_flow_style=default_flow_style, 
                             allow_unicode=allow_unicode)
    with open(p, 'w+') as f:
       f.write(content)