def iter_by_area(self):
        """Generate datasets grouped by Area.

        :return: generator of (area_obj, list of dataset objects)
        """
        datasets_by_area = {}
        for ds in self:
            a = ds.attrs.get('area')
            datasets_by_area.setdefault(a, []).append(
                DatasetID.from_dict(ds.attrs))

        return datasets_by_area.items()
def iter_by_area ( self ) : datasets_by_area = { } for ds in self : a = ds . attrs . get ( 'area' ) datasets_by_area . setdefault ( a , [ ] ) . append ( DatasetID . from_dict ( ds . attrs ) ) return datasets_by_area . items ( )
Generate datasets grouped by Area.

        :return: generator of (area_obj, list of dataset objects)