class_docstr: Writer to produce MITIFF image files.
docstr: Save all datasets to one or more files.
docstr_tok: ["Save","all","datasets","to","one","or","more","files","."]
code: def save_datasets(
      self,
      datasets,
      filename=None,
      fill_value=None,
      compute=True,
      **kwargs,
  ):
      """Save all datasets to one or more files."""
      LOG.debug("Starting in mitiff save_datasets ... ")
  
      def _delayed_create(datasets):
          dataset = datasets[0]
  
          try:
              _adjust_kwargs(dataset, kwargs)
  
              try:
                  self.mitiff_config[kwargs["sensor"]] = dataset.attrs[
                      "metadata_requirements"
                  ]["config"]
                  translate = dataset.attrs["metadata_requirements"][
                      "translate"
                  ]
                  self.translate_channel_name[
                      kwargs["sensor"]
                  ] = translate
                  self.channel_order[kwargs["sensor"]] = dataset.attrs[
                      "metadata_requirements"
                  ]["order"]
                  self.file_pattern = dataset.attrs[
                      "metadata_requirements"
                  ]["file_pattern"]
              except KeyError:
                  # For some mitiff products this info is needed, for others not.
                  # If needed you should know how to fix this
                  pass
  
              image_description = self._make_image_description(
                  datasets, **kwargs
              )
              LOG.debug("File pattern %s", self.file_pattern)
              if isinstance(datasets, list):
                  kwargs["start_time"] = dataset.attrs["start_time"]
              else:
                  kwargs["start_time"] = datasets.attrs["start_time"]
              gen_filename = filename or self.get_filename(**kwargs)
              LOG.info("Saving mitiff to: %s ...", gen_filename)
              self._save_datasets_as_mitiff(
                  datasets, image_description, gen_filename, **kwargs
              )
          except (KeyError, ValueError, RuntimeError):
              raise
  
      delayed = dask.delayed(_delayed_create)(datasets)
      LOG.debug("About to call delayed compute ...")
      if compute:
          return delayed.compute()
      return delayed
  
imports: import logging
  import os
  import dask
  import numpy
  from PIL import Image, ImagePalette
  from satpy.dataset import DataID, DataQuery
  from satpy.writers import ImageWriter, get_enhanced_image
label_desc: Use image node_id 4 for calling the MITIFFWriter obj's underlying member method code with example usage: obj.save_datasets(datasets, filename, fill_value, compute) and returns: delayed, delayed