<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_groupable(self):
 """ Checks that all receipts returned by this queryset are groupable. "Groupable" means that they can be validated together: they have the same POS and receipt type. Returns the same queryset is all receipts are groupable, otherwise, raises :class:`~.CannotValidateTogether`. """

        types = self.aggregate(
            poses=Count('point_of_sales_id', distinct=True),
            types=Count('receipt_type', distinct=True),
        )

        if set(types.values()) > {1}:
            raise exceptions.CannotValidateTogether()

        return self