code: def dissolve(self, by=None, aggfunc=None):
          # type: (Optional[str], Optional[Callable]) -> FeatureCollection
          
          if by:
              agg = partial(dissolve, aggfunc=aggfunc)  # type: Callable[[BaseCollection], GeoFeature]
              return self.groupby(by).agg(agg)
  
          else:
              return FeatureCollection([dissolve(self, aggfunc)])
docs: Dissolve geometries and rasters within `groupby`.