Fixed E117 and F405 flake8 warnings.
from django.core.exceptions import EmptyResultSet
from django.db.models.sql.query import * # NOQA
+from django.db.models.sql.query import Query
from django.db.models.sql.subqueries import * # NOQA
from django.db.models.sql.where import AND, OR
