code: def yaml_to_file(data: Mapping, output_dir: str, name: str) -> str:
      
      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
docs: 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