class_docstr: File handler for MODIS HDF-EOS Level 2 files.
  
  Includes error handling for files produced by IMAPP produced files.
class_docstr_tok: ["File","handler","for","MODIS","HDF-EOS","Level","2","files",".","Includes","error","handling","for","files","produced","by","IMAPP","produced","files","."]
code: def _extract_and_mask_category_dataset(
      self, dataset_id, dataset_info, var_name
  ):
      # what dimension is per-byte
      byte_dimension = (
          None
          if self.is_imapp_mask_byte1
          else dataset_info["byte_dimension"]
      )
      dataset = self._select_hdf_dataset(var_name, byte_dimension)
      # category products always have factor=1/offset=0 so don't apply them
      # also remove them so they don't screw up future satpy processing
      dataset.attrs.pop("scale_factor", None)
      dataset.attrs.pop("add_offset", None)
      # Don't do this byte work if we are using the IMAPP mask_byte1 file
      if self.is_imapp_mask_byte1:
          return dataset
  
      dataset = _extract_byte_mask(
          dataset,
          dataset_info["byte"],
          dataset_info["bit_start"],
          dataset_info["bit_count"],
      )
      dataset = self._mask_with_quality_assurance_if_needed(
          dataset, dataset_info, dataset_id
      )
      return dataset
  
imports: import logging
  import dask.array
  import numpy
  import xarray
  from satpy.readers.hdf4_utils import from_sds
  from satpy.readers.hdfeos_base import HDFEOSGeoReader
  from satpy.utils import get_legacy_chunk_size
label_desc: Use image node_id 8 for calling the ModisL2HDFFileHandler obj's underlying member method code with example usage: obj._extract_and_mask_category_dataset(dataset_id, dataset_info, var_name) and returns: dataset, dataset