Python port of AggregateSource