code: def aggregator(name, func, *args, type=None):
      'Define simple aggregator `name` that calls func(values)'
      def _func(col, rows):  # wrap builtins so they can have a .type
          vals = list(col.getValues(rows))
          try:
              return func(vals, *args)
          except Exception as e:
              if len(vals) == 0:
                  return None
              return e
  
      aggregators[name] = _defaggr(name, type, _funcf aggregator(name, func, *args, type=None):
      'Define simple aggregator `name` that calls func(values)'
      def _func(col, rows):  # wrap builtins so they can have a .type
          vals = list(col.getValues(rows))
          try:
              return func(vals, *args)
          except Exception as e:
              if len(vals) == 0:
                  return None
              return e
  
      aggregators[name] = _defaggr(name, type, _func)
docs: Define simple aggregator `name` that calls func(values)