def METHOD_NAME(self, path=None):
    """Write content to a YAML file."""
    for file in self.files:
        file._project = self._project
    data = DatasetSchemaV8(flattened=True).dump(self)
    path = path or self._metadata_path or os.path.join(self.path, OLD_METADATA_PATH)
    yaml.write_yaml(path=path, data=data)