code: def write_yaml (self, data, encoding=None, errors=None, newline=None, **kwargs):
          
          import yaml
  
          with self.open (mode='wt', encoding=encoding, errors=errors, newline=newline) as f:
              return yaml.dump (data, stream=f, **kwargs)
docs: Read *data* to this path as a YAML document.
  
          The *encoding*, *errors*, and *newline* keywords are passed to
          :meth:`open`. The remaining *kwargs* are passed to :meth:`yaml.dump`.