'Calculate stats for all valid operations.'

def calculate_stats(self, table, column_id, **kwargs):

    stats = {}
    for (op_name, op_data) in OPERATIONS.items():
        getter = globals().get(('get_%s' % op_name), None)
        with warnings.catch_warnings():
            warnings.simplefilter('ignore', agate.NullCalculationWarning)
            try:
                if getter:
                    stats[op_name] = getter(table, column_id, **kwargs)
                else:
                    op = op_data['aggregation']
                    v = table.aggregate(op(column_id))
                    if isinstance(v, Decimal):
                        v = format_decimal(v, locale=agate.config.get_option('default_locale'))
                    stats[op_name] = v
            except:
                stats[op_name] = None
    return stats
