code: def _compare_areas(self, datasets=None, compare_func=max):
          
          if datasets is None:
              datasets = list(self.values())
  
          areas = []
          for ds in datasets:
              if isinstance(ds, BaseDefinition):
                  areas.append(ds)
                  continue
              elif not isinstance(ds, DataArray):
                  ds = self[ds]
              area = ds.attrs.get('area')
              areas.append(area)
  
          areas = [x for x in areas if x is not None]
          if not areas:
              raise ValueError("No dataset areas available")
  
          if not all(isinstance(x, type(areas[0]))
                     for x in areas[1:]):
              raise ValueError("Can't compare areas of different types")
          elif isinstance(areas[0], AreaDefinition):
              first_pstr = areas[0].proj_str
              if not all(ad.proj_str == first_pstr for ad in areas[1:]):
                  raise ValueError("Can't compare areas with different "
                                   "projections.")
  
              def key_func(ds):
                  return 1. / ds.pixel_size_x
          else:
              def key_func(ds):
                  return ds.shape
  
          # find the highest/lowest area among the provided
          return compare_func(areas, key=key_func)
docs: Get  for the provided datasets.
  
          Args:
              datasets (iterable): Datasets whose areas will be compared. Can
                                   be either `xarray.DataArray` objects or
                                   identifiers to get the DataArrays from the
                                   current Scene. Defaults to all datasets.
                                   This can also be a series of area objects,
                                   typically AreaDefinitions.
              compare_func (callable): `min` or `max` or other function used to
                                       compare the dataset's areas.