'Aggregate a list of values.
@param values: iterable of values'

def compute(self, values):

    if (values is None):
        return None
    method = self.method
    values = [v for v in values if (v != None)]
    if (method == 'count'):
        return len(values)
    elif (method == 'min'):
        try:
            return min(values)
        except (TypeError, ValueError):
            return None
    elif (method == 'max'):
        try:
            return max(values)
        except (TypeError, ValueError):
            return None
    elif (method == 'sum'):
        try:
            return sum(values)
        except (TypeError, ValueError):
            return None
    elif (method == 'avg'):
        try:
            num = len(values)
            if num:
                return (sum(values) / float(num))
        except (TypeError, ValueError):
            return None
    elif (method == 'cumulate'):
        try:
            return sum(((base + (slope * duration)) for (base, slope, duration) in values))
        except (TypeError, ValueError):
            return None
    return None
