def __init__(self, filename, mode='r', format=None, group=None,
                 writer=None):
        import h5netcdf.legacyapi
        if format not in [None, 'NETCDF4']:
            raise ValueError('invalid format for h5netcdf backend')
        ds = h5netcdf.legacyapi.Dataset(filename, mode=mode)
        with close_on_error(ds):
            self.ds = _nc4_group(ds, group, mode)
        self.format = format
        self._filename = filename
        super(H5NetCDFStore, self).__init__(writer)
dataset/ETHPy150Open pydata/xarray/xarray/backends/h5netcdf_.py/H5NetCDFStore.__init__/original