def METHOD_NAME(self, event):
    stats = (
        Session.query.filter_by(event_id=event.id, deleted_at=None)
        .with_entities(Session.state, func.count())
        .group_by(Session.state)
        .all()
    )
    data = dict(stats)
    data['all'] = sum([x for _, x in stats])
    return data