class_docstr: Shared operations for file handlers.
class_docstr_tok: ["Shared","operations","for","file","handlers","."]
docstr: Set dataset attributes.
docstr_tok: ["Set","dataset","attributes","."]
code: def _set_attributes(self, variable, dataset_info, segmented=False):
      """Set dataset attributes."""
      if segmented:
          xdim, ydim = "number_of_FoR_cols", "number_of_FoR_rows"
      else:
          xdim, ydim = "number_of_columns", "number_of_rows"
  
      if dataset_info["file_key"] not in [
          "product_quality",
          "product_completeness",
          "product_timeliness",
      ]:
          variable = variable.rename({ydim: "y", xdim: "x"})
  
      variable.attrs.setdefault("units", None)
      variable.attrs.update(dataset_info)
      variable.attrs.update(self._get_global_attributes())
  
      return variable
  
imports: import logging
  from contextlib import suppress
  import numpy
  import xarray
  from pyresample import geometry
  from satpy._compat import cached_property
  from satpy.readers._geos_area import get_geos_area_naming, make_ext
  from satpy.readers.eum_base import get_service_mode
  from satpy.readers.file_handlers import BaseFileHandler
  from satpy.resample import get_area_def
  from satpy.utils import get_legacy_chunk_size
label_desc: Use image node_id 5 for calling the FciL2CommonFunctions obj's underlying member method code with example usage: obj._set_attributes(variable, dataset_info, segmented) and returns: variable