code: def _set_default_time_encoding(encoding, dataset):
      """Set default time encoding.
  
      Make sure time coordinates and bounds have the same units.
      Default is xarray's CF datetime encoding, which can be overridden
      by user-defined encoding.
      """
      if "time" in dataset:
          try:
              dtnp64 = dataset["time"].data[0]
          except IndexError:
              dtnp64 = dataset["time"].data
  
          default = CFDatetimeCoder().encode(xr.DataArray(dtnp64))
          time_enc = {
              "units": default.attrs["units"],
              "calendar": default.attrs["calendar"],
          }
          time_enc.update(encoding.get("time", {}))
          bounds_enc = {
              "units": time_enc["units"],
              "calendar": time_enc["calendar"],
              "_FillValue": None,
          }
          encoding["time"] = time_enc
          encoding[
              "time_bnds"
          ] = bounds_enc  # FUTURE: Not required anymore with xarray-0.14+
      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 3 for calling a global function with example usage: _set_default_time_encoding(encoding, dataset) and returns: encoding