def apply_yaml_file(data: Dict[str, Any], filename: str) -> Tuple[str, Dict[str, Any]]:
    """Apply changes from a YAML file to configuration.

    :param data: configuration data structure.
    :param filename: name of the YAML file, ``-`` is taken to mean standard input.

    :returns: tuple of human-readable and parsed data structure after changes.
    """
    changed_data = copy.deepcopy(data)

    if filename == '-':
        new_options = yaml.safe_load(sys.stdin)
    else:
        with open(filename) as fd:
            new_options = yaml.safe_load(fd)

    patch_config(changed_data, new_options)

    return format_config_for_editing(changed_data), changed_data
Apply changes from a YAML file to configuration.

    :param data: configuration data structure.
    :param filename: name of the YAML file, ``-`` is taken to mean standard input.

    :returns: tuple of human-readable and parsed data structure after changes.
    
patroni/ctl.py