(sum1, sum2)
return sum1
Used in reduce function. Aggregate the result calculate from each partition.

        Parameters
        ----------
        sum1 :  list.
            It is like:
            [[label_0_sum, label_1_sum, ...], [label_0_sum, label_1_sum, ...] ... ]
        sum2 : list
            Same as sum1
        Returns
        -------
        Merged sum. The format is same as sum1.
Used in reduce function. Aggregate the result calculate from each partition.
Used in reduce function . Aggregate the result calculate from each partition .
def aggregate_partition_label(sum1, sum2):
        """
        Used in reduce function. Aggregate the result calculate from each partition.

        Parameters
        ----------
        sum1 :  list.
            It is like:
            [[label_0_sum, label_1_sum, ...], [label_0_sum, label_1_sum, ...] ... ]
        sum2 : list
            Same as sum1
        Returns
        -------
        Merged sum. The format is same as sum1.

        """
        if sum1 is None and sum2 is None:
            return None

        if sum1 is None:
            return sum2

        if sum2 is None:
            return sum1

        for idx, label_sum2 in enumerate(sum2):
            if idx >= len(sum1):
                sum1.append(label_sum2)
            else:
                sum1[idx] = sum1[idx] + label_sum2
        return sum1
def aggregate_partition_label ( sum1 , sum2 ) : if sum1 is None and sum2 is None : return None if sum1 is None : return sum2 if sum2 is None : return sum1 for idx , label_sum2 in enumerate ( sum2 ) : if idx >= len ( sum1 ) : sum1 . append ( label_sum2 ) else : sum1 [ idx ] = sum1 [ idx ] + label_sum2 return sum1