def _column_builder(self, col):
        """Return a callable that builds a column or aggregate object"""
        if len(col.name) > 1:
            # Aggregate
            try:
                aclass = aggregate_functions[col.name[0]]
            except __HOLE__:
                raise KeyError("Unknown aggregate function %s" % col.name[0])
            return lambda:aclass(col.name[1], col.alias if col.alias else '%s(%s)' % (col.name[0], col.name[1]))
        else:
            # Column
            return lambda:Column(col.name[0], col.alias)
dataset/ETHPy150Open samuel/squawk/squawk/query.py/Query._column_builder