code: def dissolve(collection, aggfunc=None):
      # type: (BaseCollection, Optional[Callable[[list], Any]]) -> GeoFeature
      
      new_properties = {}
      if aggfunc:
          temp_properties = defaultdict(list)  # type: DefaultDict[Any, Any]
          for feature in collection:
              for key, value in feature.attributes.items():
                  temp_properties[key].append(value)
  
          for key, values in temp_properties.items():
              try:
                  new_properties[key] = aggfunc(values)
  
              except Exception:
                  # We just do not use these results
                  pass
  
      return GeoFeature(collection.cascaded_union, new_properties)
docs: Dissolves features contained in a FeatureCollection and applies an aggregation
      function to its properties.