def save_yamlf(data: Union[list, dict], fpath: str, encoding: str) -> str:
    """
    :param data: list | dict data
    :param fpath: write path
    :param encoding: encoding
    :rtype: written path
    """
    with codecs.open(fpath, mode='w', encoding=encoding) as f:
        f.write(dump_yaml(data))
        return fpath
def save_yamlf ( data : Union [ list , dict ] , fpath : str , encoding : str ) -> str : with codecs . open ( fpath , mode = 'w' , encoding = encoding ) as f : f . write ( dump_yaml ( data ) ) return fpath
:param data: list | dict data
    :param fpath: write path
    :param encoding: encoding
    :rtype: written path