def prepare_variable(self, name, variable, check_encoding=False):
        import h5py

        attrs = variable.attrs.copy()
        variable, dtype = _nc4_values_and_dtype(variable)
        if dtype is str:
            dtype = h5py.special_dtype(vlen=unicode_type)

        self.set_necessary_dimensions(variable)

        fill_value = attrs.pop('_FillValue', None)
        if ['\x00'] in fill_value:
            fill_value = None

        encoding = _extract_h5nc_encoding(variable,
                                          raise_on_invalid=check_encoding)
        kwargs = {}

        for key in ['zlib', 'complevel', 'shuffle',
                    'chunksizes', 'fletcher32']:
            if key in encoding:
                kwargs[key] = encoding[key]

        nc4_var = self.ds.createVariable(name, dtype, variable.dims,
                                         fill_value=fill_value, **kwargs)

        for k, v in iteritems(attrs):
            nc4_var.setncattr(k, v)
        return nc4_var, variable.data
dataset/ETHPy150Open pydata/xarray/xarray/backends/h5netcdf_.py/H5NetCDFStore.prepare_variable/swapped operands of `in`