code: def generate_write_yaml_to_file(file_name):
      
      def write_yaml(config):
          with open(file_name, 'w+') as fh:
              fh.write(yaml.dump(config))
      return write_yaml
docs: generate a method to write the configuration in yaml to the method desired