question: public static List < GeoTimeSerie > partitionAndApply ( Object function , WarpScriptStack stack , Macro validator , Collection < String > bylabels , List < GeoTimeSerie > ... series ) throws WarpScriptException { Map < Map < String , String > , List < GeoTimeSerie > > unflattened = partitionAndApplyUnflattened ( function , stack , validator , bylabels , series ) ; List < GeoTimeSerie > results = new ArrayList < GeoTimeSerie > ( ) ; for ( List < GeoTimeSerie > l : unflattened . values ( ) ) { results . addAll ( l ) ; } return results ; }
target:  Apply a function (either a filter or n-ary op) onto collections of GTS instances. Let's assume there are N collections in 'series'. The GTS instances from collections among those N that have more than 1 element will be partitioned. For each partition P, the function F will be called with arguments F(labels, S(Ci,Pi), S(C1,P2), ... S(Ci,Pi), ...., S(CN,PN)) where S(Ci,Pi) is either the collection Ci if card(Ci) == 1 or only those series from Pi which belong to Ci. 'labels' is the set of common labels in the partition.