code: def _group_by_area(self, datasets):
          
          def _area_id(area_def):
              return area_def.name + str(area_def.area_extent) + str(area_def.shape)
  
          # get all of the datasets stored by area
          area_datasets = {}
          for x in datasets:
              area_id = _area_id(x.attrs['area'])
              area, ds_list = area_datasets.setdefault(area_id, (x.attrs['area'], []))
              ds_list.append(x)
          return area_datasets
docs: Group datasets by their area.