code: def _check_moon_phase(
      moon_datasets: list[xr.DataArray], start_time: datetime
  ) -> float:
      """Check if we have Moon phase as an input dataset and, if not, calculate it."""
      if moon_datasets:
          # convert to decimal instead of %
          return da.mean(moon_datasets[0].data) * 0.01
  
      LOG.debug(
          "Moon illumination fraction not present. Calculating from start time."
      )
      try:
          import ephem
      except ImportError:
          raise ImportError(
              "The 'ephem' library is required to calculate moon illumination fraction"
          )
      return ephem.Moon(start_time).moon_phase
  
imports: from __future__ import annotations
  import logging
  import math
  from datetime import datetime
  import dask
  import dask.array
  import numpy
  import xarray
  from satpy.composites import CompositeBase, GenericCompositor
  from satpy.dataset import combine_metadata
label_desc: Use image node_id 11 for calling a global function with example usage: _check_moon_phase(moon_datasets, start_time) and returns: ephem, unknown