    def setxattr(self, copy_kwargs=None, **kwargs):
        """Set metadata.
        See :func:`~s3fs.S3Filesystem.setxattr`.

        Examples
        --------
        >>> mys3file.setxattr(attribute_1='value1', attribute_2='value2')  # doctest: +SKIP
        """
        if self.writable():
            raise NotImplementedError(
                "cannot update metadata while file is open for writing"
            )
        return self.fs.setxattr(self.path, copy_kwargs=copy_kwargs, **kwargs)
Set metadata.
See :func:`~s3fs.S3Filesystem.setxattr`.

Examples
--------
>>> mys3file.setxattr(attribute_1='value1', attribute_2='value2')  # doctest: +SKIP
s3fs/core.py