def METHOD_NAME(self, data, flags=0):
    if self.__closed:
        raise OSError(errno.EBADF, os.strerror(errno.EBADF))
    if not isinstance(flags, int):
        raise TypeError(
            "an integer is required (got type {})".format(type(flags).__name__)
        )
    self.flags = flags
    if self.__chunk is None:
        return self._sender.write(data)
    return self._sender.write(data[: self.__chunk])