code: def _set_default_chunks(encoding, dataset):
      """Update encoding to preserve current dask chunks.
  
      Existing user-defined chunks take precedence.
      """
      for var_name, variable in dataset.variables.items():
          if variable.chunks:
              chunks = tuple(
                  np.stack(
                      [variable.data.chunksize, variable.shape]
                  ).min(axis=0)
              )  # Chunksize may not exceed shape
              encoding.setdefault(var_name, {})
              encoding[var_name].setdefault("chunksizes", chunks)
      return encoding
  
file_path: satpy/satpy/cf/encoding.py
imports: import logging
  import numpy
  import xarray
  from xarray.coding.times import CFDatetimeCoder
label_desc: Use image node_id 1 for calling a global function with example usage: _set_default_chunks(encoding, dataset) and returns: encoding