def can_approx_count(queryset):
    query = queryset.query

    if query.select or query.group_by or query.distinct:
        return False
    elif query.high_mark is not None or query.low_mark != 0:
        return False

    # Visit parts of the where clause - if any is not a query hint, fail
    for child in query.where.children:
        if not isinstance(child, ExtraWhere):
            return False
        elif not all((sql in REWRITE_MARKER) for sql in child.sqls):
            return False

    if hasattr(query, 'having') and query.having:  # Django < 1.9
        return False  # pragma: no cover

    return True
dataset/ETHPy150Open adamchainz/django-mysql/django_mysql/models/query.py/can_approx_count/swapped operands of `in`