code: def open_dataset(filename, resolution=1000):
      """Open a dataset for a given resolution."""
      if resolution not in [1000, 4000, 8000]:
          raise ValueError(
              f"Resolution {resolution} not available. Available resolutions: 1000, 4000, 8000"
          )
  
      h5ds = xr.open_dataset(filename, engine="h5netcdf", chunks="auto")
      h5ds_raw = xr.open_dataset(
          filename,
          engine="h5netcdf",
          chunks="auto",
          mask_and_scale=False,
      )
      ds = xr.Dataset()
      ds.attrs = h5ds.attrs
      for channel in CHANNELS_BY_RESOLUTION[resolution]:
          var_name = "IMG_" + channel.upper()
          channel_data = h5ds_raw[var_name]
          ds[var_name] = channel_data
  
          for name in [
              var_name + "_" + suffix
              for suffix in LUT_SUFFIXES[channel]
          ]:
              lut = h5ds[name]
              decoded = decode_lut_arr(channel_data, lut)
              ds[name] = decoded
  
          lonlat_suffix = get_lonlat_suffix(resolution)
  
          for coord in ["Longitude", "Latitude"]:
              var_name = coord + lonlat_suffix
              ds[var_name] = h5ds[var_name]
  
      ds = _rename_dims(ds)
      return ds
  
imports: from contextlib import suppress
  from datetime import datetime
  from functools import cached_property
  import dask.array
  import numpy
  import xarray
  from satpy.utils import import_error_helper
  from satpy.readers.file_handlers import BaseFileHandler
label_desc: Use image node_id 4 for calling a global function with example usage: open_dataset(filename, resolution) and returns: ds