def update_yaml_with(target, source):
    """Merge the source YAML tree into the target. Useful for merging config files."""
    if isinstance(target, dict) and isinstance(source, dict):
        for k, v in source.items():
            if k not in target:
                target[k] = v
            else:
                target[k] = update_yaml_with(target[k], v)
    return source