def execute(self):
        cursor = self.cursor()
        cursor.execute(self.command)
        columns = [column[0] for column in cursor.description]

        totals = dict.fromkeys((field[0] for field in self.fields), 0)
        for row in cursor:
            row_dict = dict(zip(columns, row))
            if row_dict['database'] in (self.dbwatched, self.dbwatched + '\x00'):
                for field in self.fields:
                    totals[field[0]] += row_dict[field[0]]

        return dict((field[0], totals[field[0]]) for field in self.fields)
dataset/ETHPy150Open samuel/python-munin/munin/pgbouncer.py/MuninPgBouncerPlugin.execute/original