'Compute the aggregated value
@param method: the aggregation method
@param values: the values
@return: the aggregated value'

def __compute(self, method, values):

    result = None
    if (values is not None):
        try:
            values = [v for v in values if (v is not None)]
        except TypeError:
            result = None
        else:
            if (method == 'count'):
                result = len(set(values))
            else:
                values = [v for v in values if isinstance(v, (float, int, long))]
            if (method == 'sum'):
                try:
                    result = math.fsum(values)
                except (TypeError, ValueError):
                    result = None
            elif (method == 'min'):
                try:
                    result = min(values)
                except (TypeError, ValueError):
                    result = None
            elif (method == 'max'):
                try:
                    result = max(values)
                except (TypeError, ValueError):
                    result = None
            elif (method == 'avg'):
                num = len(values)
                if num:
                    try:
                        result = (sum(values) / float(num))
                    except (TypeError, ValueError):
                        result = None
                else:
                    result = None
    return result
