def METHOD_NAME(self, file):
    """
    Write a NPZ file.
    Parameters
    ----------
    file : file-like object or str
        The file to be read.
        Alternatively, a file path can be supplied.
    """
    if isinstance(file, str):
        with open(file, "wb") as f:
            np.savez(f, **self._data_dict)
    else:
        if not is_binary(file):
            raise TypeError("A file opened in 'binary' mode is required")
        np.savez(file, **self._data_dict)