<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def yaml_to_file(data: Mapping, output_dir: str, name: str) -> str: """ Save the given object to the given path in YAML. :param data: dict/list to be dumped :param output_dir: target output directory :param name: target filename :return: target path """

    dumped_config_f = path.join(output_dir, name)
    with open(dumped_config_f, 'w') as file:
        yaml.dump(data, file, Dumper=ruamel.yaml.RoundTripDumper)
    return dumped_config_f