<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def aggregate(self, On=None, AggFuncDict=None, AggFunc=None, AggList = None, returnsort=False,KeepOthers=True, keyfuncdict=None):
 """ Aggregate a tabarray on columns for given functions. Method wraps:: tabular.spreadsheet.aggregate(self, On, AggFuncDict, AggFunc, returnsort) """

        if returnsort:
            [data, s] = spreadsheet.aggregate(X=self, 
                     On=On, 
                     AggFuncDict=AggFuncDict, 
                     AggFunc=AggFunc, 
                     AggList=AggList, 
                     returnsort=returnsort, 
                     keyfuncdict=keyfuncdict)
        else:
            data = spreadsheet.aggregate(X=self, On=On, AggFuncDict=AggFuncDict, 
                     AggFunc=AggFunc, AggList = AggList, returnsort=returnsort, 
                     KeepOthers=KeepOthers,
                     keyfuncdict=keyfuncdict)
        data = data.view(tabarray)
        data.coloring = self.coloring
        if returnsort:
            return [data, s]
        else:
            return data