def _no_criterion_assertion(self, meth, order_by=True, distinct=True):
    if (not self._enable_assertions):
        return
    if ((self._criterion is not None) or (self._statement is not None) or self._from_obj or (self._limit is not None) or (self._offset is not None) or self._group_by or (order_by and self._order_by) or (distinct and self._distinct)):
        raise sa_exc.InvalidRequestError(('Query.%s() being called on a Query with existing criterion. ' % meth))
def _no_criterion_assertion(self, meth, order_by=True, distinct=True):
    if (not self._enable_assertions):
        return
    if ((self._criterion is not None) or (self._statement is not None) or self._from_obj or (self._limit is not None) or (self._offset is not None) or self._group_by or (order_by and self._order_by) or (distinct and self._distinct)):
        raise sa_exc.InvalidRequestError(('Query.%s() being called on a Query with existing criterion. ' % meth))