'Update the yaml source at the path according to the update dict.
All the previous bindings not in the update dict remain unchanged.
The yaml file at the path is re-written with the new bindings.
Args:
path [string]: Path to a yaml source file.
update_dict [dict]: Nested dictionary corresponding to
nested yaml properties, keyed by strings.
add_new_nodes [boolean]: If true, add nodes in update_dict that
were not in the original. Otherwise raise a KeyError.'

@staticmethod
def update_yml_source(path, update_dict, add_new_nodes=True):

    bindings = YamlBindings()
    bindings.import_dict(update_dict)
    updated_keys = bindings.__get_flat_keys(bindings.__map)
    source = ''
    with open(path, 'r') as source_file:
        source = source_file.read()
        for prop in updated_keys:
            source = bindings.transform_yaml_source(source, prop, add_new_nodes=add_new_nodes)
    with open(path, 'w') as source_file:
        source_file.write(source)
