Index: django/test/client.py
===================================================================
--- django/test/client.py	(revision 16529)
+++ django/test/client.py	(working copy)
@@ -5,7 +5,7 @@
 import mimetypes
 import warnings
 from copy import copy
-from urlparse import urlparse, urlunparse, urlsplit
+from urlparse import urlparse, urlsplit
 try:
     from cStringIO import StringIO
 except ImportError:
@@ -24,7 +24,7 @@
 from django.utils.http import urlencode
 from django.utils.importlib import import_module
 from django.utils.itercompat import is_iterable
-from django.db import transaction, close_connection
+from django.db import close_connection
 from django.test.utils import ContextList
 
 __all__ = ('Client', 'RequestFactory', 'encode_file', 'encode_multipart')
Index: django/test/testcases.py
===================================================================
--- django/test/testcases.py	(revision 16529)
+++ django/test/testcases.py	(working copy)
@@ -6,7 +6,7 @@
 from urlparse import urlsplit, urlunsplit
 from xml.dom.minidom import parseString, Node
 
-from django.conf import settings, UserSettingsHolder
+from django.conf import settings
 from django.core import mail
 from django.core.management import call_command
 from django.core.signals import request_started
Index: django/test/utils.py
===================================================================
--- django/test/utils.py	(revision 16529)
+++ django/test/utils.py	(working copy)
@@ -1,12 +1,8 @@
 from __future__ import with_statement
 
-import sys
-import time
-import os
 import warnings
 from django.conf import settings, UserSettingsHolder
 from django.core import mail
-from django.core.mail.backends import locmem
 from django.test.signals import template_rendered, setting_changed
 from django.template import Template, loader, TemplateDoesNotExist
 from django.template.loaders import cached
Index: django/db/models/sql/compiler.py
===================================================================
--- django/db/models/sql/compiler.py	(revision 16529)
+++ django/db/models/sql/compiler.py	(working copy)
@@ -5,8 +5,8 @@
 from django.db.models.sql.constants import *
 from django.db.models.sql.datastructures import EmptyResultSet
 from django.db.models.sql.expressions import SQLEvaluator
-from django.db.models.sql.query import get_proxied_model, get_order_dir, \
-     select_related_descend, Query
+from django.db.models.sql.query import (get_proxied_model, get_order_dir,
+     select_related_descend, Query)
 from django.db.utils import DatabaseError
 
 class SQLCompiler(object):
Index: django/db/models/sql/where.py
===================================================================
--- django/db/models/sql/where.py	(revision 16529)
+++ django/db/models/sql/where.py	(working copy)
@@ -6,7 +6,6 @@
 
 from django.utils import tree
 from django.db.models.fields import Field
-from django.db.models.query_utils import QueryWrapper
 from datastructures import EmptyResultSet, FullResultSet
 
 # Connection types
Index: django/db/models/sql/subqueries.py
===================================================================
--- django/db/models/sql/subqueries.py	(revision 16529)
+++ django/db/models/sql/subqueries.py	(working copy)
@@ -3,11 +3,9 @@
 """
 
 from django.core.exceptions import FieldError
-from django.db import connections
 from django.db.models.fields import DateField, FieldDoesNotExist
 from django.db.models.sql.constants import *
 from django.db.models.sql.datastructures import Date
-from django.db.models.sql.expressions import SQLEvaluator
 from django.db.models.sql.query import Query
 from django.db.models.sql.where import AND, Constraint
 
Index: django/db/models/base.py
===================================================================
--- django/db/models/base.py	(revision 16529)
+++ django/db/models/base.py	(working copy)
@@ -1,6 +1,5 @@
 import copy
 import sys
-import types
 from functools import update_wrapper
 from itertools import izip
 
@@ -8,8 +7,7 @@
 from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned, FieldError, ValidationError, NON_FIELD_ERRORS
 from django.core import validators
 from django.db.models.fields import AutoField, FieldDoesNotExist
-from django.db.models.fields.related import (OneToOneRel, ManyToOneRel,
-    OneToOneField, add_lazy_relation)
+from django.db.models.fields.related import ManyToOneRel, OneToOneField, add_lazy_relation
 from django.db.models.query import Q
 from django.db.models.query_utils import DeferredAttribute
 from django.db.models.deletion import Collector
Index: django/db/models/manager.py
===================================================================
--- django/db/models/manager.py	(revision 16529)
+++ django/db/models/manager.py	(working copy)
@@ -1,5 +1,4 @@
 import copy
-from django.conf import settings
 from django.db import router
 from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
 from django.db.models import signals
Index: django/db/models/loading.py
===================================================================
--- django/db/models/loading.py	(revision 16529)
+++ django/db/models/loading.py	(working copy)
@@ -6,7 +6,6 @@
 from django.utils.importlib import import_module
 from django.utils.module_loading import module_has_submodule
 
-import imp
 import sys
 import os
 import threading
Index: django/db/models/fields/__init__.py
===================================================================
--- django/db/models/fields/__init__.py	(revision 16529)
+++ django/db/models/fields/__init__.py	(working copy)
@@ -17,7 +17,7 @@
 from django.utils.translation import ugettext_lazy as _
 from django.utils.encoding import smart_unicode, force_unicode, smart_str
 from django.utils import datetime_safe
-from django.utils.ipv6 import clean_ipv6_address, is_valid_ipv6_address
+from django.utils.ipv6 import clean_ipv6_address
 
 class NOT_PROVIDED:
     pass
Index: django/db/models/fields/related.py
===================================================================
--- django/db/models/fields/related.py	(revision 16529)
+++ django/db/models/fields/related.py	(working copy)
@@ -1,5 +1,4 @@
-from django.conf import settings
-from django.db import connection, router, transaction
+from django.db import connection, router
 from django.db.backends import util
 from django.db.models import signals, get_model
 from django.db.models.fields import (AutoField, Field, IntegerField,
@@ -9,8 +8,7 @@
 from django.db.models.query_utils import QueryWrapper
 from django.db.models.deletion import CASCADE
 from django.utils.encoding import smart_unicode
-from django.utils.translation import (ugettext_lazy as _, string_concat,
-    ungettext, ugettext)
+from django.utils.translation import ugettext_lazy as _, string_concat
 from django.utils.functional import curry
 from django.core import exceptions
 from django import forms
Index: django/db/models/fields/files.py
===================================================================
--- django/db/models/fields/files.py	(revision 16529)
+++ django/db/models/fields/files.py	(working copy)
@@ -1,18 +1,14 @@
 import datetime
 import os
 
-from django.conf import settings
+from django import forms
 from django.db.models.fields import Field
-from django.core.files.base import File, ContentFile
+from django.core.files.base import File
 from django.core.files.storage import default_storage
-from django.core.files.images import ImageFile, get_image_dimensions
-from django.core.files.uploadedfile import UploadedFile
-from django.utils.functional import curry
+from django.core.files.images import ImageFile
 from django.db.models import signals
 from django.utils.encoding import force_unicode, smart_str
-from django.utils.translation import ugettext_lazy, ugettext as _
-from django import forms
-from django.db.models.loading import cache
+from django.utils.translation import ugettext_lazy as _
 
 class FieldFile(File):
     def __init__(self, instance, field, name):
@@ -215,7 +211,7 @@
     # The descriptor to use for accessing the attribute off of the class.
     descriptor_class = FileDescriptor
 
-    description = ugettext_lazy("File path")
+    description = _("File path")
 
     def __init__(self, verbose_name=None, name=None, upload_to='', storage=None, **kwargs):
         for arg in ('primary_key', 'unique'):
@@ -321,7 +317,7 @@
 class ImageField(FileField):
     attr_class = ImageFieldFile
     descriptor_class = ImageFileDescriptor
-    description = ugettext_lazy("File path")
+    description = _("File path")
 
     def __init__(self, verbose_name=None, name=None, width_field=None, height_field=None, **kwargs):
         self.width_field, self.height_field = width_field, height_field
Index: django/db/models/deletion.py
===================================================================
--- django/db/models/deletion.py	(revision 16529)
+++ django/db/models/deletion.py	(working copy)
@@ -3,7 +3,6 @@
 
 from django.db import connections, transaction, IntegrityError
 from django.db.models import signals, sql
-from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
 from django.utils.datastructures import SortedDict
 
 
Index: django/db/models/query.py
===================================================================
--- django/db/models/query.py	(revision 16529)
+++ django/db/models/query.py	(working copy)
@@ -3,15 +3,12 @@
 """
 
 import copy
-from itertools import izip
 
 from django.db import connections, router, transaction, IntegrityError
-from django.db.models.aggregates import Aggregate
-from django.db.models.fields import DateField
 from django.db.models.query_utils import (Q, select_related_descend,
     deferred_class_factory, InvalidQuery)
 from django.db.models.deletion import Collector
-from django.db.models import signals, sql
+from django.db.models import sql
 
 # Used to control how many objects are worked with at once in some cases (e.g.
 # when deleting objects).
Index: django/db/models/query_utils.py
===================================================================
--- django/db/models/query_utils.py	(revision 16529)
+++ django/db/models/query_utils.py	(working copy)
@@ -10,7 +10,6 @@
 
 from django.db.backends import util
 from django.utils import tree
-from django.utils.datastructures import SortedDict
 
 
 class InvalidQuery(Exception):
Index: django/db/__init__.py
===================================================================
--- django/db/__init__.py	(revision 16529)
+++ django/db/__init__.py	(working copy)
@@ -1,8 +1,8 @@
 from django.conf import settings
 from django.core import signals
 from django.core.exceptions import ImproperlyConfigured
-from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \
-                            DatabaseError, IntegrityError
+from django.db.utils import (ConnectionHandler, ConnectionRouter,
+    load_backend, DEFAULT_DB_ALIAS, DatabaseError, IntegrityError)
 
 __all__ = ('backend', 'connection', 'connections', 'router', 'DatabaseError',
     'IntegrityError', 'DEFAULT_DB_ALIAS')
Index: django/db/backends/sqlite3/base.py
===================================================================
--- django/db/backends/sqlite3/base.py	(revision 16529)
+++ django/db/backends/sqlite3/base.py	(working copy)
@@ -5,9 +5,10 @@
 standard library.
 """
 
+import datetime
+import decimal
 import re
 import sys
-import datetime
 
 from django.db import utils
 from django.db.backends import *
Index: django/db/backends/mysql/base.py
===================================================================
--- django/db/backends/mysql/base.py	(revision 16529)
+++ django/db/backends/mysql/base.py	(working copy)
@@ -4,6 +4,7 @@
 Requires MySQLdb: http://sourceforge.net/projects/mysql-python
 """
 
+import decimal
 import re
 import sys
 
Index: django/db/backends/oracle/base.py
===================================================================
--- django/db/backends/oracle/base.py	(revision 16529)
+++ django/db/backends/oracle/base.py	(working copy)
@@ -6,7 +6,7 @@
 
 
 import datetime
-from decimal import Decimal
+import decimal
 import sys
 
 
@@ -730,7 +730,7 @@
                     # This will normally be an integer from a sequence,
                     # but it could be a decimal value.
                     if '.' in value:
-                        value = Decimal(value)
+                        value = decimal.Decimal(value)
                     else:
                         value = int(value)
                 else:
@@ -743,12 +743,12 @@
                 if scale == 0:
                     value = int(value)
                 else:
-                    value = Decimal(value)
+                    value = decimal.Decimal(value)
             elif '.' in value:
                 # No type information. This normally comes from a
                 # mathematical expression in the SELECT list. Guess int
                 # or Decimal based on whether it has a decimal point.
-                value = Decimal(value)
+                value = decimal.Decimal(value)
             else:
                 value = int(value)
         elif desc[1] in (Database.STRING, Database.FIXED_CHAR,
Index: django/db/backends/oracle/creation.py
===================================================================
--- django/db/backends/oracle/creation.py	(revision 16529)
+++ django/db/backends/oracle/creation.py	(working copy)
@@ -1,4 +1,5 @@
-import sys, time
+import sys
+import time
 from django.db.backends.creation import BaseDatabaseCreation
 
 TEST_DATABASE_PREFIX = 'test_'
Index: django/db/backends/__init__.py
===================================================================
--- django/db/backends/__init__.py	(revision 16529)
+++ django/db/backends/__init__.py	(working copy)
@@ -1,4 +1,3 @@
-import decimal
 try:
     import thread
 except ImportError:
Index: django/db/backends/postgresql_psycopg2/base.py
===================================================================
--- django/db/backends/postgresql_psycopg2/base.py	(revision 16529)
+++ django/db/backends/postgresql_psycopg2/base.py	(working copy)
@@ -3,7 +3,6 @@
 
 Requires psycopg 2: http://initd.org/projects/psycopg2
 """
-
 import sys
 
 from django.db import utils
Index: django/db/backends/postgresql_psycopg2/operations.py
===================================================================
--- django/db/backends/postgresql_psycopg2/operations.py	(revision 16529)
+++ django/db/backends/postgresql_psycopg2/operations.py	(working copy)
@@ -1,5 +1,3 @@
-import re
-
 from django.db.backends import BaseDatabaseOperations
 
 
Index: django/db/backends/dummy/base.py
===================================================================
--- django/db/backends/dummy/base.py	(revision 16529)
+++ django/db/backends/dummy/base.py	(working copy)
@@ -7,6 +7,8 @@
 ImproperlyConfigured.
 """
 
+import decimal
+
 from django.core.exceptions import ImproperlyConfigured
 from django.db.backends import *
 from django.db.backends.creation import BaseDatabaseCreation
Index: django/db/transaction.py
===================================================================
--- django/db/transaction.py	(revision 16529)
+++ django/db/transaction.py	(working copy)
@@ -13,10 +13,8 @@
 """
 from __future__ import with_statement
 
-import sys
 from functools import wraps
 
-from django.conf import settings
 from django.db import connections, DEFAULT_DB_ALIAS
 
 
Index: django/forms/extras/widgets.py
===================================================================
--- django/forms/extras/widgets.py	(revision 16529)
+++ django/forms/extras/widgets.py	(working copy)
@@ -2,7 +2,6 @@
 Extra HTML Widget classes
 """
 
-import time
 import datetime
 import re
 
Index: django/forms/models.py
===================================================================
--- django/forms/models.py	(revision 16529)
+++ django/forms/models.py	(working copy)
@@ -8,8 +8,7 @@
 from django.utils.text import get_text_list, capfirst
 from django.utils.translation import ugettext_lazy as _, ugettext
 
-from django.core.exceptions import ValidationError, NON_FIELD_ERRORS, \
-                                   FieldError
+from django.core.exceptions import ValidationError, NON_FIELD_ERRORS, FieldError
 from django.core.validators import EMPTY_VALUES
 from util import ErrorList
 from forms import BaseForm, get_declared_fields
Index: django/core/mail/__init__.py
===================================================================
--- django/core/mail/__init__.py	(revision 16529)
+++ django/core/mail/__init__.py	(working copy)
@@ -11,11 +11,11 @@
 # django/core/mail.py before the introduction of email
 # backends and the subsequent reorganization (See #10355)
 from django.core.mail.utils import CachedDnsName, DNS_NAME
-from django.core.mail.message import \
-    EmailMessage, EmailMultiAlternatives, \
-    SafeMIMEText, SafeMIMEMultipart, \
-    DEFAULT_ATTACHMENT_MIME_TYPE, make_msgid, \
-    BadHeaderError, forbid_multi_line_headers
+from django.core.mail.message import (
+    EmailMessage, EmailMultiAlternatives,
+    SafeMIMEText, SafeMIMEMultipart,
+    DEFAULT_ATTACHMENT_MIME_TYPE, make_msgid,
+    BadHeaderError, forbid_multi_line_headers)
 from django.core.mail.backends.smtp import EmailBackend as _SMTPConnection
 
 def get_connection(backend=None, fail_silently=False, **kwds):
Index: django/core/servers/basehttp.py
===================================================================
--- django/core/servers/basehttp.py	(revision 16529)
+++ django/core/servers/basehttp.py	(working copy)
@@ -18,7 +18,6 @@
 from wsgiref.util import FileWrapper   # for backwards compatibility
 
 import django
-from django.core.exceptions import ImproperlyConfigured
 from django.core.management.color import color_style
 from django.utils._os import safe_join
 from django.views import static
Index: django/core/servers/fastcgi.py
===================================================================
--- django/core/servers/fastcgi.py	(revision 16529)
+++ django/core/servers/fastcgi.py	(working copy)
@@ -12,8 +12,9 @@
 pass to this server.
 """
 
+import os
+import sys
 from django.utils import importlib
-import sys, os
 
 __version__ = "0.1"
 __all__ = ["runfastcgi"]
Index: django/core/serializers/base.py
===================================================================
--- django/core/serializers/base.py	(revision 16529)
+++ django/core/serializers/base.py	(working copy)
@@ -5,8 +5,7 @@
 from StringIO import StringIO
 
 from django.db import models
-from django.utils.encoding import smart_str, smart_unicode
-from django.utils import datetime_safe
+from django.utils.encoding import smart_unicode
 
 class SerializerDoesNotExist(KeyError):
     """The requested serializer was not found."""
Index: django/core/handlers/profiler-hotshot.py
===================================================================
--- django/core/handlers/profiler-hotshot.py	(revision 16529)
+++ django/core/handlers/profiler-hotshot.py	(working copy)
@@ -1,4 +1,7 @@
-import hotshot, time, os
+import hotshot
+import os
+import time
+
 from django.core.handlers.modpython import ModPythonHandler
 
 PROFILE_DATA_DIR = "/var/log/cmsprofile"
Index: django/core/handlers/wsgi.py
===================================================================
--- django/core/handlers/wsgi.py	(revision 16529)
+++ django/core/handlers/wsgi.py	(working copy)
@@ -1,11 +1,9 @@
-from pprint import pformat
 import sys
 from threading import Lock
 try:
     from cStringIO import StringIO
 except ImportError:
     from StringIO import StringIO
-import socket
 
 from django import http
 from django.core import signals
Index: django/core/handlers/modpython.py
===================================================================
--- django/core/handlers/modpython.py	(revision 16529)
+++ django/core/handlers/modpython.py	(working copy)
@@ -1,5 +1,4 @@
 import os
-from pprint import pformat
 import sys
 from warnings import warn
 
@@ -8,7 +7,7 @@
 from django.core.handlers.base import BaseHandler
 from django.core.urlresolvers import set_script_prefix
 from django.utils import datastructures
-from django.utils.encoding import force_unicode, smart_str, iri_to_uri
+from django.utils.encoding import force_unicode, iri_to_uri
 from django.utils.log import getLogger
 
 logger = getLogger('django.request')
Index: django/core/cache/backends/base.py
===================================================================
--- django/core/cache/backends/base.py	(revision 16529)
+++ django/core/cache/backends/base.py	(working copy)
@@ -2,7 +2,6 @@
 
 import warnings
 
-from django.conf import settings
 from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
 from django.utils.encoding import smart_str
 from django.utils.importlib import import_module
Index: django/core/cache/backends/db.py
===================================================================
--- django/core/cache/backends/db.py	(revision 16529)
+++ django/core/cache/backends/db.py	(working copy)
@@ -2,12 +2,13 @@
 
 from django.core.cache.backends.base import BaseCache
 from django.db import connections, router, transaction, DatabaseError
-import base64, time
+import base64
 from datetime import datetime
 try:
     import cPickle as pickle
 except ImportError:
     import pickle
+import time
 
 class Options(object):
     """A class that will quack like a Django model _meta class.
Index: django/core/cache/backends/memcached.py
===================================================================
--- django/core/cache/backends/memcached.py	(revision 16529)
+++ django/core/cache/backends/memcached.py	(working copy)
@@ -4,7 +4,6 @@
 from threading import local
 
 from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError
-from django.utils import importlib
 
 class BaseMemcachedCache(BaseCache):
     def __init__(self, server, params, library, value_not_found_exception):
Index: django/core/management/commands/reset.py
===================================================================
--- django/core/management/commands/reset.py	(revision 16529)
+++ django/core/management/commands/reset.py	(working copy)
@@ -1,6 +1,5 @@
 from optparse import make_option
 
-from django.conf import settings
 from django.core.management.base import AppCommand, CommandError
 from django.core.management.color import no_style
 from django.core.management.sql import sql_reset
Index: django/templatetags/future.py
===================================================================
--- django/templatetags/future.py	(revision 16529)
+++ django/templatetags/future.py	(working copy)
@@ -1,7 +1,5 @@
-from django.conf import settings
-from django.template import Library, Node, Template, TemplateSyntaxError
-from django.template.defaulttags import kwarg_re, include_is_allowed, SsiNode, URLNode
-from django.utils.encoding import smart_str
+from django.template import Library, TemplateSyntaxError
+from django.template.defaulttags import kwarg_re, SsiNode, URLNode
 
 
 register = Library()
Index: django/templatetags/l10n.py
===================================================================
--- django/templatetags/l10n.py	(revision 16529)
+++ django/templatetags/l10n.py	(working copy)
@@ -1,4 +1,3 @@
-from django.conf import settings
 from django.template import Node
 from django.template import TemplateSyntaxError, Library
 from django.utils import formats
Index: django/templatetags/cache.py
===================================================================
--- django/templatetags/cache.py	(revision 16529)
+++ django/templatetags/cache.py	(working copy)
@@ -2,7 +2,6 @@
 from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist
 from django.template import resolve_variable
 from django.core.cache import cache
-from django.utils.encoding import force_unicode
 from django.utils.http import urlquote
 
 register = Library()
Index: django/views/decorators/http.py
===================================================================
--- django/views/decorators/http.py	(revision 16529)
+++ django/views/decorators/http.py	(working copy)
@@ -3,7 +3,6 @@
 """
 
 from calendar import timegm
-from datetime import timedelta
 from functools import wraps
 
 from django.utils.decorators import decorator_from_middleware, available_attrs
Index: django/views/generic/base.py
===================================================================
--- django/views/generic/base.py	(revision 16529)
+++ django/views/generic/base.py	(working copy)
@@ -1,7 +1,6 @@
 from functools import update_wrapper
 from django import http
 from django.core.exceptions import ImproperlyConfigured
-from django.template import RequestContext, loader
 from django.template.response import TemplateResponse
 from django.utils.log import getLogger
 from django.utils.decorators import classonlymethod
Index: django/views/generic/list.py
===================================================================
--- django/views/generic/list.py	(revision 16529)
+++ django/views/generic/list.py	(working copy)
@@ -1,5 +1,3 @@
-import re
-
 from django.core.paginator import Paginator, InvalidPage
 from django.core.exceptions import ImproperlyConfigured
 from django.http import Http404
Index: django/views/generic/detail.py
===================================================================
--- django/views/generic/detail.py	(revision 16529)
+++ django/views/generic/detail.py	(working copy)
@@ -1,5 +1,3 @@
-import re
-
 from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
 from django.http import Http404
 from django.utils.encoding import smart_str
Index: django/views/debug.py
===================================================================
--- django/views/debug.py	(revision 16529)
+++ django/views/debug.py	(working copy)
@@ -3,7 +3,6 @@
 import re
 import sys
 import types
-from pprint import pformat
 
 from django.conf import settings
 from django.http import (HttpResponse, HttpResponseServerError,
Index: django/dispatch/saferef.py
===================================================================
--- django/dispatch/saferef.py	(revision 16529)
+++ django/dispatch/saferef.py	(working copy)
@@ -5,7 +5,8 @@
 aren't handled by the core weakref module).
 """
 
-import weakref, traceback
+import traceback
+import weakref
 
 def safeRef(target, onDelete = None):
     """Return a *safe* weak reference to a callable target
Index: django/utils/translation/trans_real.py
===================================================================
--- django/utils/translation/trans_real.py	(revision 16529)
+++ django/utils/translation/trans_real.py	(working copy)
@@ -4,11 +4,14 @@
 import os
 import re
 import sys
-import warnings
 import gettext as gettext_module
-from cStringIO import StringIO
 from threading import local
 
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
+
 from django.utils.importlib import import_module
 from django.utils.safestring import mark_safe, SafeData
 
Index: django/utils/translation/trans_null.py
===================================================================
--- django/utils/translation/trans_null.py	(revision 16529)
+++ django/utils/translation/trans_null.py	(working copy)
@@ -2,7 +2,6 @@
 # that don't actually do anything. This is purely for performance, so that
 # settings.USE_I18N = False can use this module rather than trans_real.py.
 
-import warnings
 from django.conf import settings
 from django.utils.encoding import force_unicode
 from django.utils.safestring import mark_safe, SafeData
Index: django/utils/cache.py
===================================================================
--- django/utils/cache.py	(revision 16529)
+++ django/utils/cache.py	(working copy)
@@ -26,7 +26,6 @@
 from django.utils.encoding import smart_str, iri_to_uri
 from django.utils.http import http_date
 from django.utils.translation import get_language
-from django.http import HttpRequest
 
 cc_delim_re = re.compile(r'\s*,\s*')
 
Index: django/utils/timesince.py
===================================================================
--- django/utils/timesince.py	(revision 16529)
+++ django/utils/timesince.py	(working copy)
@@ -1,5 +1,4 @@
 import datetime
-import time
 
 from django.utils.tzinfo import LocalTimezone
 from django.utils.translation import ungettext, ugettext
Index: django/utils/log.py
===================================================================
--- django/utils/log.py	(revision 16529)
+++ django/utils/log.py	(working copy)
@@ -1,5 +1,4 @@
 import logging
-import sys
 import traceback
 
 from django.conf import settings
Index: django/utils/text.py
===================================================================
--- django/utils/text.py	(revision 16529)
+++ django/utils/text.py	(working copy)
@@ -1,9 +1,17 @@
 import re
+from gzip import GzipFile
+from htmlentitydefs import name2codepoint
+
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
+
 from django.utils.encoding import force_unicode
 from django.utils.functional import allow_lazy
 from django.utils.translation import ugettext_lazy, ugettext as _
-from htmlentitydefs import name2codepoint
 
+
 # Capitalizes the first letter of a string.
 capfirst = lambda x: x and force_unicode(x)[0].upper() + force_unicode(x)[1:]
 capfirst = allow_lazy(capfirst, unicode)
@@ -180,9 +188,8 @@
 # From http://www.xhaus.com/alan/python/httpcomp.html#gzip
 # Used with permission.
 def compress_string(s):
-    import cStringIO, gzip
-    zbuf = cStringIO.StringIO()
-    zfile = gzip.GzipFile(mode='wb', compresslevel=6, fileobj=zbuf)
+    zbuf = StringIO()
+    zfile = GzipFile(mode='wb', compresslevel=6, fileobj=zbuf)
     zfile.write(s)
     zfile.close()
     return zbuf.getvalue()
Index: django/utils/version.py
===================================================================
--- django/utils/version.py	(revision 16529)
+++ django/utils/version.py	(working copy)
@@ -1,5 +1,4 @@
 import django
-import os.path
 import re
 
 def get_svn_revision(path=None):
Index: django/contrib/gis/db/models/sql/aggregates.py
===================================================================
--- django/contrib/gis/db/models/sql/aggregates.py	(revision 16529)
+++ django/contrib/gis/db/models/sql/aggregates.py	(working copy)
@@ -1,6 +1,5 @@
 from django.db.models.sql.aggregates import *
 from django.contrib.gis.db.models.fields import GeometryField
-from django.contrib.gis.db.models.sql.conversion import GeomField
 
 class GeoAggregate(Aggregate):
     # Default SQL template for spatial aggregates.
Index: django/contrib/gis/db/models/sql/where.py
===================================================================
--- django/contrib/gis/db/models/sql/where.py	(revision 16529)
+++ django/contrib/gis/db/models/sql/where.py	(working copy)
@@ -1,4 +1,4 @@
-from django.db.models.fields import Field, FieldDoesNotExist
+from django.db.models.fields import FieldDoesNotExist
 from django.db.models.sql.constants import LOOKUP_SEP
 from django.db.models.sql.expressions import SQLEvaluator
 from django.db.models.sql.where import Constraint, WhereNode
Index: django/contrib/gis/db/models/__init__.py
===================================================================
--- django/contrib/gis/db/models/__init__.py	(revision 16529)
+++ django/contrib/gis/db/models/__init__.py	(working copy)
@@ -8,7 +8,7 @@
 from django.contrib.gis.db.models.manager import GeoManager
 
 # The geographic-enabled fields.
-from django.contrib.gis.db.models.fields import \
-     GeometryField, PointField, LineStringField, PolygonField, \
-     MultiPointField, MultiLineStringField, MultiPolygonField, \
-     GeometryCollectionField
+from django.contrib.gis.db.models.fields import (
+     GeometryField, PointField, LineStringField, PolygonField,
+     MultiPointField, MultiLineStringField, MultiPolygonField,
+     GeometryCollectionField)
Index: django/contrib/gis/db/models/query.py
===================================================================
--- django/contrib/gis/db/models/query.py	(revision 16529)
+++ django/contrib/gis/db/models/query.py	(working copy)
@@ -1,9 +1,9 @@
 from django.db import connections
-from django.db.models.query import QuerySet, Q, ValuesQuerySet, ValuesListQuerySet
+from django.db.models.query import QuerySet, ValuesQuerySet, ValuesListQuerySet
 
 from django.contrib.gis.db.models import aggregates
-from django.contrib.gis.db.models.fields import get_srid_info, GeometryField, PointField, LineStringField
-from django.contrib.gis.db.models.sql import AreaField, DistanceField, GeomField, GeoQuery, GeoWhereNode
+from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField
+from django.contrib.gis.db.models.sql import AreaField, DistanceField, GeomField, GeoQuery
 from django.contrib.gis.geometry.backend import Geometry
 from django.contrib.gis.measure import Area, Distance
 
Index: django/contrib/gis/db/backends/spatialite/base.py
===================================================================
--- django/contrib/gis/db/backends/spatialite/base.py	(revision 16529)
+++ django/contrib/gis/db/backends/spatialite/base.py	(working copy)
@@ -3,8 +3,8 @@
 
 from django.core.exceptions import ImproperlyConfigured
 from django.db.backends.sqlite3.base import *
-from django.db.backends.sqlite3.base import DatabaseWrapper as SqliteDatabaseWrapper, \
-    _sqlite_extract, _sqlite_date_trunc, _sqlite_regexp
+from django.db.backends.sqlite3.base import DatabaseWrapper as SqliteDatabaseWrapper
+from django.db.backends.sqlite3.base import _sqlite_extract, _sqlite_date_trunc, _sqlite_regexp
 from django.contrib.gis.db.backends.spatialite.client import SpatiaLiteClient
 from django.contrib.gis.db.backends.spatialite.creation import SpatiaLiteCreation
 from django.contrib.gis.db.backends.spatialite.introspection import SpatiaLiteIntrospection
Index: django/contrib/gis/db/backends/base.py
===================================================================
--- django/contrib/gis/db/backends/base.py	(revision 16529)
+++ django/contrib/gis/db/backends/base.py	(working copy)
@@ -3,7 +3,6 @@
 `SpatialRefSys` model the backend.
 """
 import re
-from django.conf import settings
 from django.contrib.gis import gdal
 
 class BaseSpatialOperations(object):
Index: django/contrib/gis/db/backends/oracle/models.py
===================================================================
--- django/contrib/gis/db/backends/oracle/models.py	(revision 16529)
+++ django/contrib/gis/db/backends/oracle/models.py	(working copy)
@@ -8,7 +8,6 @@
  model and the `SDO_COORD_REF_SYS` is used for the SpatialRefSys model.
 """
 from django.contrib.gis.db import models
-from django.contrib.gis.db.models.fields import GeometryField
 from django.contrib.gis.db.backends.base import SpatialRefSysMixin
 
 class GeometryColumns(models.Model):
Index: django/contrib/gis/shortcuts.py
===================================================================
--- django/contrib/gis/shortcuts.py	(revision 16529)
+++ django/contrib/gis/shortcuts.py	(working copy)
@@ -1,11 +1,15 @@
-import cStringIO, zipfile
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
+import zipfile
 from django.conf import settings
 from django.http import HttpResponse
 from django.template import loader
 
 def compress_kml(kml):
     "Returns compressed KMZ from the given KML string."
-    kmz = cStringIO.StringIO()
+    kmz = StringIO()
     zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED)
     zf.writestr('doc.kml', kml.encode(settings.DEFAULT_CHARSET))
     zf.close()
Index: django/contrib/gis/admin/options.py
===================================================================
--- django/contrib/gis/admin/options.py	(revision 16529)
+++ django/contrib/gis/admin/options.py	(working copy)
@@ -1,4 +1,3 @@
-from django.conf import settings
 from django.contrib.admin import ModelAdmin
 from django.contrib.gis.admin.widgets import OpenLayersWidget
 from django.contrib.gis.gdal import OGRGeomType
Index: django/contrib/gis/admin/widgets.py
===================================================================
--- django/contrib/gis/admin/widgets.py	(revision 16529)
+++ django/contrib/gis/admin/widgets.py	(working copy)
@@ -1,4 +1,3 @@
-from django.conf import settings
 from django.forms.widgets import Textarea
 from django.template import loader, Context
 from django.templatetags.static import static
Index: django/contrib/gis/geometry/backend/geos.py
===================================================================
--- django/contrib/gis/geometry/backend/geos.py	(revision 16529)
+++ django/contrib/gis/geometry/backend/geos.py	(working copy)
@@ -1,3 +1,2 @@
-from django.contrib.gis.geos import \
-    GEOSGeometry as Geometry, \
-    GEOSException as GeometryException
+from django.contrib.gis.geos import (
+    GEOSGeometry as Geometry, GEOSException as GeometryException)
Index: django/contrib/gis/geos/geometry.py
===================================================================
--- django/contrib/gis/geos/geometry.py	(revision 16529)
+++ django/contrib/gis/geos/geometry.py	(working copy)
@@ -3,9 +3,8 @@
  inherit from this object.
 """
 # Python, ctypes and types dependencies.
-import re
 import warnings
-from ctypes import addressof, byref, c_double, c_size_t
+from ctypes import addressof, byref, c_double
 
 # super-class for mutable list behavior
 from django.contrib.gis.geos.mutable_list import ListMixin
Index: django/contrib/gis/geos/prototypes/topology.py
===================================================================
--- django/contrib/gis/geos/prototypes/topology.py	(revision 16529)
+++ django/contrib/gis/geos/prototypes/topology.py	(working copy)
@@ -7,7 +7,7 @@
            'geos_linemerge', 'geos_pointonsurface', 'geos_preservesimplify',
            'geos_simplify', 'geos_symdifference', 'geos_union', 'geos_relate']
 
-from ctypes import c_char_p, c_double, c_int
+from ctypes import c_double, c_int
 from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOS_PREPARE
 from django.contrib.gis.geos.prototypes.errcheck import check_geom, check_string
 from django.contrib.gis.geos.prototypes.geom import geos_char_p
Index: django/contrib/gis/geos/prototypes/__init__.py
===================================================================
--- django/contrib/gis/geos/prototypes/__init__.py	(revision 16529)
+++ django/contrib/gis/geos/prototypes/__init__.py	(working copy)
@@ -5,26 +5,26 @@
 """
 
 # Coordinate sequence routines.
-from django.contrib.gis.geos.prototypes.coordseq import create_cs, get_cs, \
-    cs_clone, cs_getordinate, cs_setordinate, cs_getx, cs_gety, cs_getz, \
-    cs_setx, cs_sety, cs_setz, cs_getsize, cs_getdims
+from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs,
+    cs_clone, cs_getordinate, cs_setordinate, cs_getx, cs_gety, cs_getz,
+    cs_setx, cs_sety, cs_setz, cs_getsize, cs_getdims)
 
 # Geometry routines.
-from django.contrib.gis.geos.prototypes.geom import from_hex, from_wkb, from_wkt, \
-    create_point, create_linestring, create_linearring, create_polygon, create_collection, \
-    destroy_geom, get_extring, get_intring, get_nrings, get_geomn, geom_clone, \
-    geos_normalize, geos_type, geos_typeid, geos_get_srid, geos_set_srid, \
-    get_dims, get_num_coords, get_num_geoms, \
-    to_hex, to_wkb, to_wkt
+from django.contrib.gis.geos.prototypes.geom import (from_hex, from_wkb, from_wkt,
+    create_point, create_linestring, create_linearring, create_polygon, create_collection,
+    destroy_geom, get_extring, get_intring, get_nrings, get_geomn, geom_clone,
+    geos_normalize, geos_type, geos_typeid, geos_get_srid, geos_set_srid,
+    get_dims, get_num_coords, get_num_geoms,
+    to_hex, to_wkb, to_wkt)
 
 # Miscellaneous routines.
 from django.contrib.gis.geos.prototypes.misc import *
 
 # Predicates
-from django.contrib.gis.geos.prototypes.predicates import geos_hasz, geos_isempty, \
-    geos_isring, geos_issimple, geos_isvalid, geos_contains, geos_crosses, \
-    geos_disjoint, geos_equals, geos_equalsexact, geos_intersects, \
-    geos_intersects, geos_overlaps, geos_relatepattern, geos_touches, geos_within
+from django.contrib.gis.geos.prototypes.predicates import (geos_hasz, geos_isempty,
+    geos_isring, geos_issimple, geos_isvalid, geos_contains, geos_crosses,
+    geos_disjoint, geos_equals, geos_equalsexact, geos_intersects,
+    geos_intersects, geos_overlaps, geos_relatepattern, geos_touches, geos_within)
 
 # Topology routines
 from django.contrib.gis.geos.prototypes.topology import *
Index: django/contrib/gis/geos/prototypes/geom.py
===================================================================
--- django/contrib/gis/geos/prototypes/geom.py	(revision 16529)
+++ django/contrib/gis/geos/prototypes/geom.py	(working copy)
@@ -1,7 +1,7 @@
-from ctypes import c_char_p, c_int, c_size_t, c_ubyte, c_uint, POINTER
-from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, PREPGEOM_PTR, GEOS_PREPARE
-from django.contrib.gis.geos.prototypes.errcheck import \
-    check_geom, check_minus_one, check_sized_string, check_string, check_zero
+from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER
+from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR
+from django.contrib.gis.geos.prototypes.errcheck import (
+    check_geom, check_minus_one, check_sized_string, check_string, check_zero)
 from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
 
 # This is the return type used by binary output (WKB, HEX) routines.
Index: django/contrib/gis/geos/base.py
===================================================================
--- django/contrib/gis/geos/base.py	(revision 16529)
+++ django/contrib/gis/geos/base.py	(working copy)
@@ -1,6 +1,6 @@
 from ctypes import c_void_p
 from types import NoneType
-from django.contrib.gis.geos.error import GEOSException, GEOSIndexError
+from django.contrib.gis.geos.error import GEOSException
 
 # Trying to import GDAL libraries, if available.  Have to place in
 # try/except since this package may be used outside GeoDjango.
Index: django/contrib/gis/geos/tests/test_geos.py
===================================================================
--- django/contrib/gis/geos/tests/test_geos.py	(revision 16529)
+++ django/contrib/gis/geos/tests/test_geos.py	(working copy)
@@ -1,4 +1,6 @@
-import ctypes, random, unittest, sys
+import ctypes
+import random
+import unittest
 from django.contrib.gis.geos import *
 from django.contrib.gis.geos.base import gdal, numpy, GEOSBase
 from django.contrib.gis.geos.libgeos import GEOS_PREPARE
Index: django/contrib/gis/geos/tests/test_geos_mutation.py
===================================================================
--- django/contrib/gis/geos/tests/test_geos_mutation.py	(revision 16529)
+++ django/contrib/gis/geos/tests/test_geos_mutation.py	(working copy)
@@ -2,7 +2,6 @@
 # Modified from original contribution by Aryeh Leib Taurog, which was
 # released under the New BSD license.
 
-import copy
 from django.contrib.gis.geos import *
 from django.contrib.gis.geos.error import GEOSIndexError
 from django.utils import unittest
Index: django/contrib/gis/geos/tests/test_io.py
===================================================================
--- django/contrib/gis/geos/tests/test_io.py	(revision 16529)
+++ django/contrib/gis/geos/tests/test_io.py	(working copy)
@@ -1,4 +1,5 @@
-import binascii, ctypes, unittest
+import binascii
+import unittest
 from django.contrib.gis.geos import GEOSGeometry, WKTReader, WKTWriter, WKBReader, WKBWriter, geos_version_info
 
 class GEOSIOTest(unittest.TestCase):
Index: django/contrib/gis/geos/collections.py
===================================================================
--- django/contrib/gis/geos/collections.py	(revision 16529)
+++ django/contrib/gis/geos/collections.py	(working copy)
@@ -3,9 +3,9 @@
  GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
 """
 from ctypes import c_int, c_uint, byref
-from django.contrib.gis.geos.error import GEOSException, GEOSIndexError
+from django.contrib.gis.geos.error import GEOSException
 from django.contrib.gis.geos.geometry import GEOSGeometry
-from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR, GEOS_PREPARE
+from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOS_PREPARE
 from django.contrib.gis.geos.linestring import LineString, LinearRing
 from django.contrib.gis.geos.point import Point
 from django.contrib.gis.geos.polygon import Polygon
Index: django/contrib/gis/geos/libgeos.py
===================================================================
--- django/contrib/gis/geos/libgeos.py	(revision 16529)
+++ django/contrib/gis/geos/libgeos.py	(working copy)
@@ -6,7 +6,9 @@
  This module also houses GEOS Pointer utilities, including
  get_pointer_arr(), and GEOM_PTR.
 """
-import os, re, sys
+import os
+import re
+import sys
 from ctypes import c_char_p, Structure, CDLL, CFUNCTYPE, POINTER
 from ctypes.util import find_library
 from django.contrib.gis.geos.error import GEOSException
Index: django/contrib/gis/geos/polygon.py
===================================================================
--- django/contrib/gis/geos/polygon.py	(revision 16529)
+++ django/contrib/gis/geos/polygon.py	(working copy)
@@ -1,5 +1,4 @@
 from ctypes import c_uint, byref
-from django.contrib.gis.geos.error import GEOSIndexError
 from django.contrib.gis.geos.geometry import GEOSGeometry
 from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR
 from django.contrib.gis.geos.linestring import LinearRing
Index: django/contrib/gis/maps/google/gmap.py
===================================================================
--- django/contrib/gis/maps/google/gmap.py	(revision 16529)
+++ django/contrib/gis/maps/google/gmap.py	(working copy)
@@ -1,11 +1,12 @@
 from django.conf import settings
-from django.contrib.gis import geos
 from django.template.loader import render_to_string
 from django.utils.safestring import mark_safe
 
-class GoogleMapException(Exception): pass
-from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker, GIcon
+class GoogleMapException(Exception):
+    pass
 
+from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker
+
 # The default Google Maps URL (for the API javascript)
 # TODO: Internationalize for Japan, UK, etc.
 GOOGLE_MAPS_URL='http://maps.google.com/maps?file=api&amp;v=%s&amp;key='
Index: django/contrib/gis/maps/google/zoom.py
===================================================================
--- django/contrib/gis/maps/google/zoom.py	(revision 16529)
+++ django/contrib/gis/maps/google/zoom.py	(working copy)
@@ -1,6 +1,6 @@
 from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point
 from django.contrib.gis.maps.google.gmap import GoogleMapException
-from math import pi, sin, cos, log, exp, atan
+from math import pi, sin, log, exp, atan
 
 # Constants used for degree to radian conversion, and vice-versa.
 DTOR = pi / 180.
Index: django/contrib/gis/utils/layermapping.py
===================================================================
--- django/contrib/gis/utils/layermapping.py	(revision 16529)
+++ django/contrib/gis/utils/layermapping.py	(working copy)
@@ -7,15 +7,14 @@
    http://geodjango.org/docs/layermapping.html
 """
 import sys
-from datetime import date, datetime
 from decimal import Decimal
 from django.core.exceptions import ObjectDoesNotExist
 from django.db import connections, DEFAULT_DB_ALIAS
 from django.contrib.gis.db.models import GeometryField
-from django.contrib.gis.gdal import CoordTransform, DataSource, \
-    OGRException, OGRGeometry, OGRGeomType, SpatialReference
-from django.contrib.gis.gdal.field import \
-    OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTTime
+from django.contrib.gis.gdal import (CoordTransform, DataSource,
+    OGRException, OGRGeometry, OGRGeomType, SpatialReference)
+from django.contrib.gis.gdal.field import (
+    OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTTime)
 from django.db import models, transaction
 from django.contrib.localflavor.us.models import USStateField
 
Index: django/contrib/gis/utils/ogrinspect.py
===================================================================
--- django/contrib/gis/utils/ogrinspect.py	(revision 16529)
+++ django/contrib/gis/utils/ogrinspect.py	(working copy)
@@ -8,7 +8,7 @@
 from itertools import izip
 # Requires GDAL to use.
 from django.contrib.gis.gdal import DataSource
-from django.contrib.gis.gdal.field import OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTTime
+from django.contrib.gis.gdal.field import OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString
 
 def mapping(data_source, geom_name='geom', layer_key=0, multi_geom=False):
     """
Index: django/contrib/gis/utils/geoip.py
===================================================================
--- django/contrib/gis/utils/geoip.py	(revision 16529)
+++ django/contrib/gis/utils/geoip.py	(working copy)
@@ -38,7 +38,8 @@
  >>> g.geos('24.124.1.80').wkt
  'POINT (-95.2087020874023438 39.0392990112304688)'
 """
-import os, re
+import os
+import re
 from ctypes import c_char_p, c_float, c_int, Structure, CDLL, POINTER
 from ctypes.util import find_library
 from django.conf import settings
Index: django/contrib/gis/tests/test_spatialrefsys.py
===================================================================
--- django/contrib/gis/tests/test_spatialrefsys.py	(revision 16529)
+++ django/contrib/gis/tests/test_spatialrefsys.py	(working copy)
@@ -1,6 +1,6 @@
 from django.db import connection
 from django.contrib.gis.gdal import GDAL_VERSION
-from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite
+from django.contrib.gis.tests.utils import no_mysql, oracle, postgis, spatialite
 from django.utils import unittest
 
 
Index: django/contrib/gis/tests/geo3d/tests.py
===================================================================
--- django/contrib/gis/tests/geo3d/tests.py	(revision 16529)
+++ django/contrib/gis/tests/geo3d/tests.py	(working copy)
@@ -5,9 +5,9 @@
 from django.contrib.gis.geos import GEOSGeometry, Point, Polygon
 from django.contrib.gis.utils import LayerMapping, LayerMapError
 
-from models import City3D, Interstate2D, Interstate3D, \
-    InterstateProj2D, InterstateProj3D, \
-    Point2D, Point3D, MultiPoint3D, Polygon2D, Polygon3D
+from models import (City3D, Interstate2D, Interstate3D,
+    InterstateProj2D, InterstateProj3D,
+    Point2D, Point3D, MultiPoint3D, Polygon2D, Polygon3D)
 
 data_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'data'))
 city_file = os.path.join(data_path, 'cities', 'cities.shp')
Index: django/contrib/gis/tests/geogapp/tests.py
===================================================================
--- django/contrib/gis/tests/geogapp/tests.py	(revision 16529)
+++ django/contrib/gis/tests/geogapp/tests.py	(working copy)
@@ -79,7 +79,6 @@
 
     def test06_geography_area(self):
         "Testing that Area calculations work on geography columns."
-        from django.contrib.gis.measure import A
         # SELECT ST_Area(poly) FROM geogapp_zipcode WHERE code='77002';
         ref_area = 5439084.70637573
         tol = 5
Index: django/contrib/gis/tests/distapp/tests.py
===================================================================
--- django/contrib/gis/tests/distapp/tests.py	(revision 16529)
+++ django/contrib/gis/tests/distapp/tests.py	(working copy)
@@ -1,15 +1,12 @@
-import os
-from decimal import Decimal
-
 from django.db import connection
 from django.db.models import Q
-from django.contrib.gis.geos import GEOSGeometry, Point, LineString
+from django.contrib.gis.geos import GEOSGeometry, LineString
 from django.contrib.gis.measure import D # alias for Distance
 from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_spatialite
 from django.test import TestCase
 
-from models import AustraliaCity, Interstate, SouthTexasInterstate, \
-    SouthTexasCity, SouthTexasCityFt, CensusZipcode, SouthTexasZipcode
+from models import (AustraliaCity, Interstate, SouthTexasInterstate,
+    SouthTexasCity, SouthTexasCityFt, CensusZipcode, SouthTexasZipcode)
 
 class DistanceTest(TestCase):
 
Index: django/contrib/gis/tests/test_geoip.py
===================================================================
--- django/contrib/gis/tests/test_geoip.py	(revision 16529)
+++ django/contrib/gis/tests/test_geoip.py	(working copy)
@@ -1,4 +1,5 @@
-import os, unittest
+import os
+import unittest
 from django.db import settings
 from django.contrib.gis.geos import GEOSGeometry
 from django.contrib.gis.utils import GeoIP, GeoIPException
Index: django/contrib/gis/tests/layermap/tests.py
===================================================================
--- django/contrib/gis/tests/layermap/tests.py	(revision 16529)
+++ django/contrib/gis/tests/layermap/tests.py	(working copy)
@@ -4,13 +4,13 @@
 
 from django.utils.unittest import TestCase
 
-from django.contrib.gis.gdal import DataSource, OGRException
+from django.contrib.gis.gdal import DataSource
 from django.contrib.gis.tests.utils import mysql
 from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, InvalidDecimal, MissingForeignKey
 
-from models import \
-    City, County, CountyFeat, Interstate, ICity1, ICity2, Invalid, State, \
-    city_mapping, co_mapping, cofeat_mapping, inter_mapping
+from models import (
+    City, County, CountyFeat, Interstate, ICity1, ICity2, Invalid, State,
+    city_mapping, co_mapping, cofeat_mapping, inter_mapping)
 
 shp_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.pardir, 'data'))
 city_shp = os.path.join(shp_path, 'cities', 'cities.shp')
Index: django/contrib/gis/tests/geoapp/test_regress.py
===================================================================
--- django/contrib/gis/tests/geoapp/test_regress.py	(revision 16529)
+++ django/contrib/gis/tests/geoapp/test_regress.py	(working copy)
@@ -1,5 +1,5 @@
-import os, unittest
-from django.contrib.gis.tests.utils import no_mysql, no_oracle, no_postgis, no_spatialite
+import unittest
+from django.contrib.gis.tests.utils import no_mysql, no_spatialite
 from django.contrib.gis.shortcuts import render_to_kmz
 from models import City
 
Index: django/contrib/gis/tests/geoapp/tests.py
===================================================================
--- django/contrib/gis/tests/geoapp/tests.py	(revision 16529)
+++ django/contrib/gis/tests/geoapp/tests.py	(working copy)
@@ -1,12 +1,11 @@
 import re
 from django.db import connection
 from django.contrib.gis import gdal
-from django.contrib.gis.geos import fromstr, GEOSGeometry, \
-    Point, LineString, LinearRing, Polygon, GeometryCollection
-from django.contrib.gis.measure import Distance
-from django.contrib.gis.tests.utils import \
-    no_mysql, no_oracle, no_spatialite, \
-    mysql, oracle, postgis, spatialite
+from django.contrib.gis.geos import (fromstr, GEOSGeometry,
+    Point, LineString, LinearRing, Polygon, GeometryCollection)
+from django.contrib.gis.tests.utils import (
+    no_mysql, no_oracle, no_spatialite,
+    mysql, oracle, postgis, spatialite)
 from django.test import TestCase
 
 from models import Country, City, PennsylvaniaCity, State, Track
Index: django/contrib/gis/tests/geoapp/test_sitemaps.py
===================================================================
--- django/contrib/gis/tests/geoapp/test_sitemaps.py	(revision 16529)
+++ django/contrib/gis/tests/geoapp/test_sitemaps.py	(working copy)
@@ -1,4 +1,7 @@
-import cStringIO
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
 from xml.dom import minidom
 import zipfile
 from django.conf import settings
@@ -60,7 +63,7 @@
                     kml_doc = minidom.parseString(self.client.get(kml_url).content)
                 elif kml_type == 'kmz':
                     # Have to decompress KMZ before parsing.
-                    buf = cStringIO.StringIO(self.client.get(kml_url).content)
+                    buf = StringIO(self.client.get(kml_url).content)
                     zf = zipfile.ZipFile(buf)
                     self.assertEqual(1, len(zf.filelist))
                     self.assertEqual('doc.kml', zf.filelist[0].filename)
Index: django/contrib/gis/tests/geoapp/feeds.py
===================================================================
--- django/contrib/gis/tests/geoapp/feeds.py	(revision 16529)
+++ django/contrib/gis/tests/geoapp/feeds.py	(working copy)
@@ -1,6 +1,5 @@
 from django.contrib.gis import feeds
-from django.contrib.gis.tests.utils import mysql
-from models import City, Country
+from models import City
 
 class TestGeoRSS1(feeds.Feed):
     link = '/city/'
Index: django/contrib/gis/gdal/datasource.py
===================================================================
--- django/contrib/gis/gdal/datasource.py	(revision 16529)
+++ django/contrib/gis/gdal/datasource.py	(working copy)
@@ -34,7 +34,7 @@
               val = field.value
 """
 # ctypes prerequisites.
-from ctypes import byref, c_void_p
+from ctypes import byref
 
 # The GDAL C library, OGR exceptions, and the Layer object.
 from django.contrib.gis.gdal.base import GDALBase
Index: django/contrib/gis/gdal/feature.py
===================================================================
--- django/contrib/gis/gdal/feature.py	(revision 16529)
+++ django/contrib/gis/gdal/feature.py	(working copy)
@@ -3,7 +3,6 @@
 from django.contrib.gis.gdal.error import OGRException, OGRIndexError
 from django.contrib.gis.gdal.field import Field
 from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
-from django.contrib.gis.gdal.srs import SpatialReference
 
 # ctypes function prototypes
 from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api
Index: django/contrib/gis/gdal/libgdal.py
===================================================================
--- django/contrib/gis/gdal/libgdal.py	(revision 16529)
+++ django/contrib/gis/gdal/libgdal.py	(working copy)
@@ -1,4 +1,5 @@
-import os, re, sys
+import os
+import re
 from ctypes import c_char_p, CDLL
 from ctypes.util import find_library
 from django.contrib.gis.gdal.error import OGRException
Index: django/contrib/gis/gdal/prototypes/generation.py
===================================================================
--- django/contrib/gis/gdal/prototypes/generation.py	(revision 16529)
+++ django/contrib/gis/gdal/prototypes/generation.py	(working copy)
@@ -4,9 +4,9 @@
 """
 
 from ctypes import c_char_p, c_double, c_int, c_void_p
-from django.contrib.gis.gdal.prototypes.errcheck import \
-    check_arg_errcode, check_errcode, check_geom, check_geom_offset, \
-    check_pointer, check_srs, check_str_arg, check_string, check_const_string
+from django.contrib.gis.gdal.prototypes.errcheck import (
+    check_arg_errcode, check_errcode, check_geom, check_geom_offset,
+    check_pointer, check_srs, check_str_arg, check_string, check_const_string)
 
 class gdal_char_p(c_char_p):
     pass
Index: django/contrib/gis/gdal/prototypes/ds.py
===================================================================
--- django/contrib/gis/gdal/prototypes/ds.py	(revision 16529)
+++ django/contrib/gis/gdal/prototypes/ds.py	(working copy)
@@ -6,9 +6,8 @@
 from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER
 from django.contrib.gis.gdal.envelope import OGREnvelope
 from django.contrib.gis.gdal.libgdal import lgdal
-from django.contrib.gis.gdal.prototypes.generation import \
-    const_string_output, double_output, geom_output, int_output, \
-    srs_output, void_output, voidptr_output
+from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
+    double_output, geom_output, int_output, srs_output, void_output, voidptr_output)
 
 c_int_p = POINTER(c_int) # shortcut type
 
Index: django/contrib/gis/gdal/prototypes/geom.py
===================================================================
--- django/contrib/gis/gdal/prototypes/geom.py	(revision 16529)
+++ django/contrib/gis/gdal/prototypes/geom.py	(working copy)
@@ -1,12 +1,9 @@
-import re
-from datetime import date
-from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER
+from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER
 from django.contrib.gis.gdal.envelope import OGREnvelope
 from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
 from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
-from django.contrib.gis.gdal.prototypes.generation import \
-    const_string_output, double_output, geom_output, int_output, \
-    srs_output, string_output, void_output
+from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
+    double_output, geom_output, int_output, srs_output, string_output, void_output)
 
 ### Generation routines specific to this module ###
 def env_func(f, argtypes):
Index: django/contrib/gis/gdal/prototypes/srs.py
===================================================================
--- django/contrib/gis/gdal/prototypes/srs.py	(revision 16529)
+++ django/contrib/gis/gdal/prototypes/srs.py	(working copy)
@@ -1,8 +1,7 @@
 from ctypes import c_char_p, c_int, c_void_p, POINTER
 from django.contrib.gis.gdal.libgdal import lgdal, std_call
-from django.contrib.gis.gdal.prototypes.generation import \
-    const_string_output, double_output, int_output, \
-    srs_output, string_output, void_output
+from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
+    double_output, int_output, srs_output, string_output, void_output)
 
 ## Shortcut generation for routines with known parameters.
 def srs_double(f):
Index: django/contrib/gis/gdal/srs.py
===================================================================
--- django/contrib/gis/gdal/srs.py	(revision 16529)
+++ django/contrib/gis/gdal/srs.py	(working copy)
@@ -26,12 +26,11 @@
   >>> print srs.name
   NAD83 / Texas South Central
 """
-import re
-from ctypes import byref, c_char_p, c_int, c_void_p
+from ctypes import byref, c_char_p, c_int
 
 # Getting the error checking routine and exceptions
 from django.contrib.gis.gdal.base import GDALBase
-from django.contrib.gis.gdal.error import OGRException, SRSException
+from django.contrib.gis.gdal.error import SRSException
 from django.contrib.gis.gdal.prototypes import srs as capi
 
 #### Spatial Reference class. ####
Index: django/contrib/gis/gdal/tests/test_driver.py
===================================================================
--- django/contrib/gis/gdal/tests/test_driver.py	(revision 16529)
+++ django/contrib/gis/gdal/tests/test_driver.py	(working copy)
@@ -1,4 +1,4 @@
-import os, os.path, unittest
+import unittest
 from django.contrib.gis.gdal import Driver, OGRException
 
 valid_drivers = ('ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN',
Index: django/contrib/gis/gdal/tests/test_geom.py
===================================================================
--- django/contrib/gis/gdal/tests/test_geom.py	(revision 16529)
+++ django/contrib/gis/gdal/tests/test_geom.py	(working copy)
@@ -1,8 +1,14 @@
-from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, \
-    OGRException, OGRIndexError, SpatialReference, CoordTransform, \
-    GDAL_VERSION
+from binascii import b2a_hex
+try:
+    import cPickle as pickle
+except ImportError:
+    import pickle
+
+from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType, OGRException,
+    OGRIndexError, SpatialReference, CoordTransform, GDAL_VERSION)
+from django.contrib.gis.gdal.prototypes.geom import GEOJSON
+from django.contrib.gis.geometry.test_data import TestDataMixin
 from django.utils import unittest
-from django.contrib.gis.geometry.test_data import TestDataMixin
 
 class OGRGeomTest(unittest.TestCase, TestDataMixin):
     "This tests the OGR Geometry."
@@ -92,7 +98,6 @@
 
     def test01d_wkb(self):
         "Testing WKB input/output."
-        from binascii import b2a_hex
         for g in self.geometries.hex_wkt:
             geom1 = OGRGeometry(g.wkt)
             wkb = geom1.wkb
@@ -103,7 +108,6 @@
 
     def test01e_json(self):
         "Testing GeoJSON input/output."
-        from django.contrib.gis.gdal.prototypes.geom import GEOJSON
         if not GEOJSON: return
         for g in self.geometries.json_geoms:
             geom = OGRGeometry(g.wkt)
@@ -446,9 +450,8 @@
 
     def test17_pickle(self):
         "Testing pickle support."
-        import cPickle
         g1 = OGRGeometry('LINESTRING(1 1 1,2 2 2,3 3 3)', 'WGS84')
-        g2 = cPickle.loads(cPickle.dumps(g1))
+        g2 = pickle.loads(pickle.dumps(g1))
         self.assertEqual(g1, g2)
         self.assertEqual(4326, g2.srs.srid)
         self.assertEqual(g1.srs.wkt, g2.srs.wkt)
Index: django/contrib/gis/management/commands/inspectdb.py
===================================================================
--- django/contrib/gis/management/commands/inspectdb.py	(revision 16529)
+++ django/contrib/gis/management/commands/inspectdb.py	(working copy)
@@ -1,6 +1,3 @@
-from optparse import make_option
-
-from django.core.management.base import CommandError
 from django.core.management.commands.inspectdb import Command as InspectDBCommand
 
 class Command(InspectDBCommand):
Index: django/contrib/gis/management/commands/ogrinspect.py
===================================================================
--- django/contrib/gis/management/commands/ogrinspect.py	(revision 16529)
+++ django/contrib/gis/management/commands/ogrinspect.py	(working copy)
@@ -1,4 +1,4 @@
-import os, sys
+import os
 from optparse import make_option
 from django.contrib.gis import gdal
 from django.contrib.gis.management.base import ArgsCommand, CommandError
Index: django/contrib/gis/feeds.py
===================================================================
--- django/contrib/gis/feeds.py	(revision 16529)
+++ django/contrib/gis/feeds.py	(working copy)
@@ -1,4 +1,4 @@
-from django.contrib.syndication.feeds import Feed as BaseFeed, FeedDoesNotExist
+from django.contrib.syndication.feeds import Feed as BaseFeed
 from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
 
 class GeoFeedMixin(object):
Index: django/contrib/formtools/wizard/tests/namedwizardtests/tests.py
===================================================================
--- django/contrib/formtools/wizard/tests/namedwizardtests/tests.py	(revision 16529)
+++ django/contrib/formtools/wizard/tests/namedwizardtests/tests.py	(working copy)
@@ -1,9 +1,6 @@
-import os
-
 from django.core.urlresolvers import reverse
 from django.http import QueryDict
 from django.test import TestCase
-from django.conf import settings
 
 from django.contrib.auth.models import User
 
Index: django/contrib/formtools/wizard/storage/session.py
===================================================================
--- django/contrib/formtools/wizard/storage/session.py	(revision 16529)
+++ django/contrib/formtools/wizard/storage/session.py	(working copy)
@@ -1,4 +1,3 @@
-from django.core.files.uploadedfile import UploadedFile
 from django.contrib.formtools.wizard import storage
 
 
Index: django/contrib/formtools/wizard/views.py
===================================================================
--- django/contrib/formtools/wizard/views.py	(revision 16529)
+++ django/contrib/formtools/wizard/views.py	(working copy)
@@ -1,4 +1,3 @@
-import copy
 import re
 
 from django import forms
Index: django/contrib/formtools/utils.py
===================================================================
--- django/contrib/formtools/utils.py	(revision 16529)
+++ django/contrib/formtools/utils.py	(working copy)
@@ -5,7 +5,6 @@
 
 import hashlib
 from django.conf import settings
-from django.forms import BooleanField
 from django.utils.crypto import salted_hmac
 
 
Index: django/contrib/formtools/preview.py
===================================================================
--- django/contrib/formtools/preview.py	(revision 16529)
+++ django/contrib/formtools/preview.py	(working copy)
@@ -2,12 +2,6 @@
 Formtools Preview application.
 """
 
-try:
-    import cPickle as pickle
-except ImportError:
-    import pickle
-
-from django.conf import settings
 from django.http import Http404
 from django.shortcuts import render_to_response
 from django.template.context import RequestContext
Index: django/contrib/sitemaps/views.py
===================================================================
--- django/contrib/sitemaps/views.py	(revision 16529)
+++ django/contrib/sitemaps/views.py	(working copy)
@@ -1,8 +1,7 @@
 from django.core import urlresolvers
 from django.core.paginator import EmptyPage, PageNotAnInteger
-from django.http import HttpResponse, Http404
+from django.http import Http404
 from django.template.response import TemplateResponse
-from django.utils.encoding import smart_str
 
 from django.contrib.sites.models import get_current_site
 
Index: django/contrib/sitemaps/__init__.py
===================================================================
--- django/contrib/sitemaps/__init__.py	(revision 16529)
+++ django/contrib/sitemaps/__init__.py	(working copy)
@@ -1,4 +1,4 @@
-from django.contrib.sites.models import Site, get_current_site
+from django.contrib.sites.models import Site
 from django.core import urlresolvers, paginator
 from django.core.exceptions import ImproperlyConfigured
 import urllib
Index: django/contrib/admin/templatetags/admin_list.py
===================================================================
--- django/contrib/admin/templatetags/admin_list.py	(revision 16529)
+++ django/contrib/admin/templatetags/admin_list.py	(working copy)
@@ -1,14 +1,12 @@
 import datetime
 
-from django.conf import settings
 from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
 from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE,
-    ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR)
+    ORDER_VAR, PAGE_VAR, SEARCH_VAR)
 from django.core.exceptions import ObjectDoesNotExist
 from django.db import models
 from django.templatetags.static import static
 from django.utils import formats
-from django.utils.datastructures import SortedDict
 from django.utils.html import escape, conditional_escape
 from django.utils.safestring import mark_safe
 from django.utils.text import capfirst
Index: django/contrib/admin/views/main.py
===================================================================
--- django/contrib/admin/views/main.py	(revision 16529)
+++ django/contrib/admin/views/main.py	(working copy)
@@ -19,15 +19,13 @@
 # Changelist settings
 ALL_VAR = 'all'
 ORDER_VAR = 'o'
-ORDER_TYPE_VAR = 'ot'
 PAGE_VAR = 'p'
 SEARCH_VAR = 'q'
 TO_FIELD_VAR = 't'
 IS_POPUP_VAR = 'pop'
 ERROR_FLAG = 'e'
 
-IGNORED_PARAMS = (
-    ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR, TO_FIELD_VAR)
+IGNORED_PARAMS = (ALL_VAR, ORDER_VAR, SEARCH_VAR, IS_POPUP_VAR, TO_FIELD_VAR)
 
 # Text to display within change-list table cells if the value is blank.
 EMPTY_CHANGELIST_VALUE = ugettext_lazy('(None)')
Index: django/contrib/admin/widgets.py
===================================================================
--- django/contrib/admin/widgets.py	(revision 16529)
+++ django/contrib/admin/widgets.py	(working copy)
@@ -4,7 +4,6 @@
 
 import copy
 from django import forms
-from django.conf import settings
 from django.core.urlresolvers import reverse, NoReverseMatch
 from django.forms.widgets import RadioFieldRenderer
 from django.forms.util import flatatt
Index: django/contrib/admindocs/views.py
===================================================================
--- django/contrib/admindocs/views.py	(revision 16529)
+++ django/contrib/admindocs/views.py	(working copy)
@@ -1,4 +1,8 @@
-from django import template, templatetags
+import inspect
+import os
+import re
+
+from django import template
 from django.template import RequestContext
 from django.conf import settings
 from django.contrib.admin.views.decorators import staff_member_required
@@ -12,7 +16,6 @@
 from django.utils.importlib import import_module
 from django.utils.translation import ugettext as _
 from django.utils.safestring import mark_safe
-import inspect, os, re
 
 # Exclude methods starting with these strings from documentation
 MODEL_METHODS_EXCLUDE = ('_', 'add_', 'delete', 'save', 'set_')
Index: django/contrib/auth/__init__.py
===================================================================
--- django/contrib/auth/__init__.py	(revision 16529)
+++ django/contrib/auth/__init__.py	(working copy)
@@ -1,4 +1,3 @@
-import datetime
 from warnings import warn
 from django.core.exceptions import ImproperlyConfigured
 from django.utils.importlib import import_module
Index: django/contrib/auth/backends.py
===================================================================
--- django/contrib/auth/backends.py	(revision 16529)
+++ django/contrib/auth/backends.py	(working copy)
@@ -1,4 +1,3 @@
-from django.db import connection
 from django.contrib.auth.models import User, Permission
 
 
Index: django/contrib/auth/tests/auth_backends.py
===================================================================
--- django/contrib/auth/tests/auth_backends.py	(revision 16529)
+++ django/contrib/auth/tests/auth_backends.py	(working copy)
@@ -1,5 +1,3 @@
-import warnings
-
 from django.conf import settings
 from django.contrib.auth.models import User, Group, Permission, AnonymousUser
 from django.contrib.contenttypes.models import ContentType
Index: django/contrib/auth/tests/tokens.py
===================================================================
--- django/contrib/auth/tests/tokens.py	(revision 16529)
+++ django/contrib/auth/tests/tokens.py	(working copy)
@@ -1,7 +1,7 @@
 from datetime import date, timedelta
 
 from django.conf import settings
-from django.contrib.auth.models import User, AnonymousUser
+from django.contrib.auth.models import User
 from django.contrib.auth.tokens import PasswordResetTokenGenerator
 from django.test import TestCase
 
Index: django/contrib/auth/tests/forms.py
===================================================================
--- django/contrib/auth/tests/forms.py	(revision 16529)
+++ django/contrib/auth/tests/forms.py	(working copy)
@@ -1,6 +1,5 @@
 from __future__ import with_statement
 import os
-from django.conf import settings
 from django.core import mail
 from django.contrib.auth.models import User
 from django.contrib.auth.forms import UserCreationForm, AuthenticationForm,  PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm
Index: django/contrib/auth/models.py
===================================================================
--- django/contrib/auth/models.py	(revision 16529)
+++ django/contrib/auth/models.py	(working copy)
@@ -10,9 +10,10 @@
 
 from django.contrib import auth
 from django.contrib.auth.signals import user_logged_in
+# UNUSABLE_PASSWORD is still imported here for backwards compatibility
 from django.contrib.auth.utils import (get_hexdigest, make_password,
-                                       check_password, is_password_usable,
-                                       get_random_string, UNUSABLE_PASSWORD)
+        check_password, is_password_usable, get_random_string,
+        UNUSABLE_PASSWORD)
 from django.contrib.contenttypes.models import ContentType
 
 def update_last_login(sender, user, **kwargs):
Index: django/contrib/auth/management/__init__.py
===================================================================
--- django/contrib/auth/management/__init__.py	(revision 16529)
+++ django/contrib/auth/management/__init__.py	(working copy)
@@ -102,8 +102,8 @@
     :returns: The username, or an empty string if no username can be
         determined.
     """
-    from django.contrib.auth.management.commands.createsuperuser import \
-        RE_VALID_USERNAME
+    from django.contrib.auth.management.commands.createsuperuser import (
+        RE_VALID_USERNAME)
     default_username = get_system_username()
     try:
         default_username = unicodedata.normalize('NFKD', default_username)\
Index: django/contrib/auth/forms.py
===================================================================
--- django/contrib/auth/forms.py	(revision 16529)
+++ django/contrib/auth/forms.py	(working copy)
@@ -1,10 +1,11 @@
 from django import forms
-from django.template import Context, loader
+from django.template import loader
 from django.utils.http import int_to_base36
 from django.utils.itercompat import any
 from django.utils.translation import ugettext_lazy as _
 
-from django.contrib.auth.models import User, UNUSABLE_PASSWORD
+from django.contrib.auth.models import User
+from django.contrib.auth.utils import UNUSABLE_PASSWORD
 from django.contrib.auth import authenticate
 from django.contrib.auth.tokens import default_token_generator
 from django.contrib.sites.models import get_current_site
Index: django/contrib/localflavor/kw/forms.py
===================================================================
--- django/contrib/localflavor/kw/forms.py	(revision 16529)
+++ django/contrib/localflavor/kw/forms.py	(working copy)
@@ -6,7 +6,7 @@
 
 from django.core.validators import EMPTY_VALUES
 from django.forms import ValidationError
-from django.forms.fields import Field, RegexField
+from django.forms.fields import Field
 from django.utils.translation import gettext as _
 
 id_re = re.compile(r'^(?P<initial>\d{1})(?P<yy>\d\d)(?P<mm>\d\d)(?P<dd>\d\d)(?P<mid>\d{4})(?P<checksum>\d{1})')
Index: django/contrib/localflavor/be/forms.py
===================================================================
--- django/contrib/localflavor/be/forms.py	(revision 16529)
+++ django/contrib/localflavor/be/forms.py	(working copy)
@@ -1,10 +1,6 @@
 """
 Belgium-specific Form helpers
 """
-import re
-
-from django.core.validators import EMPTY_VALUES
-from django.forms import ValidationError
 from django.forms.fields import RegexField, Select
 from django.utils.translation import ugettext_lazy as _
 
Index: django/contrib/localflavor/us/models.py
===================================================================
--- django/contrib/localflavor/us/models.py	(revision 16529)
+++ django/contrib/localflavor/us/models.py	(working copy)
@@ -1,4 +1,3 @@
-from django.conf import settings
 from django.utils.translation import ugettext_lazy as _
 from django.db.models.fields import CharField
 from django.contrib.localflavor.us.us_states import STATE_CHOICES
Index: django/contrib/localflavor/uy/forms.py
===================================================================
--- django/contrib/localflavor/uy/forms.py	(revision 16529)
+++ django/contrib/localflavor/uy/forms.py	(working copy)
@@ -2,8 +2,6 @@
 """
 UY-specific form helpers.
 """
-import re
-
 from django.core.validators import EMPTY_VALUES
 from django.forms.fields import Select, RegexField
 from django.forms import ValidationError
Index: django/contrib/localflavor/jp/forms.py
===================================================================
--- django/contrib/localflavor/jp/forms.py	(revision 16529)
+++ django/contrib/localflavor/jp/forms.py	(working copy)
@@ -2,7 +2,6 @@
 JP-specific Form helpers
 """
 
-from django.forms import ValidationError
 from django.utils.translation import ugettext_lazy as _
 from django.forms.fields import RegexField, Select
 
Index: django/contrib/localflavor/no/forms.py
===================================================================
--- django/contrib/localflavor/no/forms.py	(revision 16529)
+++ django/contrib/localflavor/no/forms.py	(working copy)
@@ -2,7 +2,8 @@
 Norwegian-specific Form helpers
 """
 
-import re, datetime
+import re
+import datetime
 from django.core.validators import EMPTY_VALUES
 from django.forms import ValidationError
 from django.forms.fields import Field, RegexField, Select
Index: django/contrib/localflavor/ro/forms.py
===================================================================
--- django/contrib/localflavor/ro/forms.py	(revision 16529)
+++ django/contrib/localflavor/ro/forms.py	(working copy)
@@ -2,9 +2,6 @@
 """
 Romanian specific form helpers.
 """
-
-import re
-
 from django.core.validators import EMPTY_VALUES
 from django.forms import ValidationError, Field, RegexField, Select
 from django.utils.translation import ugettext_lazy as _
Index: django/contrib/localflavor/pt/forms.py
===================================================================
--- django/contrib/localflavor/pt/forms.py	(revision 16529)
+++ django/contrib/localflavor/pt/forms.py	(working copy)
@@ -1,13 +1,13 @@
 """
 PT-specific Form helpers
 """
+import re
 
 from django.core.validators import EMPTY_VALUES
 from django.forms import ValidationError
-from django.forms.fields import Field, RegexField, Select
+from django.forms.fields import Field, RegexField
 from django.utils.encoding import smart_unicode
 from django.utils.translation import ugettext_lazy as _
-import re
 
 phone_digits_re = re.compile(r'^(\d{9}|(00|\+)\d*)$')
 
Index: django/contrib/localflavor/ru/forms.py
===================================================================
--- django/contrib/localflavor/ru/forms.py	(revision 16529)
+++ django/contrib/localflavor/ru/forms.py	(working copy)
@@ -3,9 +3,7 @@
 """
 import re
 
-from django.core.validators import EMPTY_VALUES
-from django.forms import ValidationError
-from django.forms.fields import CharField, Select, RegexField
+from django.forms.fields import RegexField, Select
 from django.utils.translation import ugettext_lazy as _
 
 phone_digits_re = re.compile(r'^(?:[78]-?)?(\d{3})[-\.]?(\d{3})[-\.]?(\d{4})$')
Index: django/contrib/localflavor/ar/forms.py
===================================================================
--- django/contrib/localflavor/ar/forms.py	(revision 16529)
+++ django/contrib/localflavor/ar/forms.py	(working copy)
@@ -6,7 +6,6 @@
 from django.forms import ValidationError
 from django.core.validators import EMPTY_VALUES
 from django.forms.fields import RegexField, CharField, Select
-from django.utils.encoding import smart_unicode
 from django.utils.translation import ugettext_lazy as _
 
 class ARProvinceSelect(Select):
Index: django/contrib/localflavor/au/models.py
===================================================================
--- django/contrib/localflavor/au/models.py	(revision 16529)
+++ django/contrib/localflavor/au/models.py	(working copy)
@@ -1,4 +1,3 @@
-from django.conf import settings
 from django.utils.translation import ugettext_lazy as _
 from django.db.models.fields import CharField
 
Index: django/contrib/localflavor/se/utils.py
===================================================================
--- django/contrib/localflavor/se/utils.py	(revision 16529)
+++ django/contrib/localflavor/se/utils.py	(working copy)
@@ -1,4 +1,3 @@
-import re
 import datetime
 
 def id_number_checksum(gd):
Index: django/contrib/sessions/backends/base.py
===================================================================
--- django/contrib/sessions/backends/base.py	(revision 16529)
+++ django/contrib/sessions/backends/base.py	(working copy)
@@ -2,7 +2,6 @@
 import hashlib
 import os
 import random
-import sys
 import time
 from datetime import datetime, timedelta
 try:
Index: django/contrib/sessions/backends/db.py
===================================================================
--- django/contrib/sessions/backends/db.py	(revision 16529)
+++ django/contrib/sessions/backends/db.py	(working copy)
@@ -1,5 +1,4 @@
 import datetime
-from django.conf import settings
 from django.contrib.sessions.backends.base import SessionBase, CreateError
 from django.core.exceptions import SuspiciousOperation
 from django.db import IntegrityError, transaction, router
Index: django/contrib/sessions/models.py
===================================================================
--- django/contrib/sessions/models.py	(revision 16529)
+++ django/contrib/sessions/models.py	(working copy)
@@ -1,6 +1,3 @@
-import base64
-import cPickle as pickle
-
 from django.db import models
 from django.utils.translation import ugettext_lazy as _
 
Index: django/contrib/messages/api.py
===================================================================
--- django/contrib/messages/api.py	(revision 16529)
+++ django/contrib/messages/api.py	(working copy)
@@ -1,6 +1,5 @@
 from django.contrib.messages import constants
 from django.contrib.messages.storage import default_storage
-from django.utils.functional import lazy, memoize
 
 __all__ = (
     'add_message', 'get_messages',
Index: django/contrib/messages/tests/cookie.py
===================================================================
--- django/contrib/messages/tests/cookie.py	(revision 16529)
+++ django/contrib/messages/tests/cookie.py	(working copy)
@@ -1,7 +1,7 @@
 from django.contrib.messages import constants
 from django.contrib.messages.tests.base import BaseTest
-from django.contrib.messages.storage.cookie import CookieStorage, \
-                                            MessageEncoder, MessageDecoder
+from django.contrib.messages.storage.cookie import (CookieStorage,
+    MessageEncoder, MessageDecoder)
 from django.contrib.messages.storage.base import Message
 from django.utils import simplejson as json
 from django.conf import settings
Index: django/contrib/messages/tests/base.py
===================================================================
--- django/contrib/messages/tests/base.py	(revision 16529)
+++ django/contrib/messages/tests/base.py	(working copy)
@@ -1,5 +1,3 @@
-import warnings
-
 from django import http
 from django.test import TestCase
 from django.conf import settings
Index: django/contrib/messages/tests/fallback.py
===================================================================
--- django/contrib/messages/tests/fallback.py	(revision 16529)
+++ django/contrib/messages/tests/fallback.py	(working copy)
@@ -1,11 +1,11 @@
 from django.contrib.messages import constants
-from django.contrib.messages.storage.fallback import FallbackStorage, \
-    CookieStorage
+from django.contrib.messages.storage.fallback import (FallbackStorage,
+    CookieStorage)
 from django.contrib.messages.tests.base import BaseTest
-from django.contrib.messages.tests.cookie import set_cookie_data, \
-    stored_cookie_messages_count
-from django.contrib.messages.tests.session import set_session_data, \
-    stored_session_messages_count
+from django.contrib.messages.tests.cookie import (set_cookie_data,
+    stored_cookie_messages_count)
+from django.contrib.messages.tests.session import (set_session_data,
+    stored_session_messages_count)
 
 
 class FallbackTest(BaseTest):
Index: django/contrib/messages/tests/urls.py
===================================================================
--- django/contrib/messages/tests/urls.py	(revision 16529)
+++ django/contrib/messages/tests/urls.py	(working copy)
@@ -2,7 +2,6 @@
 from django.contrib import messages
 from django.core.urlresolvers import reverse
 from django.http import HttpResponseRedirect, HttpResponse
-from django.shortcuts import render_to_response, redirect
 from django.template import RequestContext, Template
 from django.template.response import TemplateResponse
 from django.views.decorators.cache import never_cache
Index: django/contrib/messages/storage/cookie.py
===================================================================
--- django/contrib/messages/storage/cookie.py	(revision 16529)
+++ django/contrib/messages/storage/cookie.py	(working copy)
@@ -1,5 +1,4 @@
 from django.conf import settings
-from django.contrib.messages import constants
 from django.contrib.messages.storage.base import BaseStorage, Message
 from django.http import SimpleCookie
 from django.utils import simplejson as json
Index: django/bin/profiling/gather_profile_stats.py
===================================================================
--- django/bin/profiling/gather_profile_stats.py	(revision 16529)
+++ django/bin/profiling/gather_profile_stats.py	(working copy)
@@ -8,8 +8,9 @@
 """
 
 from hotshot import stats
+import os
 import pstats
-import sys, os
+import sys
 
 def gather_stats(p):
     profiles = {}
Index: django/template/base.py
===================================================================
--- django/template/base.py	(revision 16529)
+++ django/template/base.py	(working copy)
@@ -1,4 +1,3 @@
-import imp
 import re
 from functools import partial
 from inspect import getargspec
@@ -7,7 +6,6 @@
 from django.template.context import Context, RequestContext, ContextPopException
 from django.utils.importlib import import_module
 from django.utils.itercompat import is_iterable
-from django.utils.functional import Promise
 from django.utils.text import smart_split, unescape_string_literal, get_text_list
 from django.utils.encoding import smart_unicode, force_unicode, smart_str
 from django.utils.translation import ugettext_lazy
Index: django/template/loaders/cached.py
===================================================================
--- django/template/loaders/cached.py	(revision 16529)
+++ django/template/loaders/cached.py	(working copy)
@@ -4,10 +4,8 @@
 """
 
 import hashlib
-from django.core.exceptions import ImproperlyConfigured
 from django.template.base import TemplateDoesNotExist
 from django.template.loader import BaseLoader, get_template_from_string, find_template_loader, make_origin
-from django.utils.importlib import import_module
 
 class Loader(BaseLoader):
     is_usable = True
Index: django/template/defaulttags.py
===================================================================
--- django/template/defaulttags.py	(revision 16529)
+++ django/template/defaulttags.py	(working copy)
@@ -5,8 +5,12 @@
 from datetime import datetime
 from itertools import groupby, cycle as itertools_cycle
 
-from django.template.base import Node, NodeList, Template, Context, Variable
-from django.template.base import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END, SINGLE_BRACE_START, SINGLE_BRACE_END, COMMENT_TAG_START, COMMENT_TAG_END
+from django.template.base import Node, NodeList, Template
+from django.template.base import (TemplateSyntaxError, VariableDoesNotExist,
+        BLOCK_TAG_START, BLOCK_TAG_END,
+        VARIABLE_TAG_START, VARIABLE_TAG_END,
+        SINGLE_BRACE_START, SINGLE_BRACE_END,
+        COMMENT_TAG_START, COMMENT_TAG_END)
 from django.template.base import get_library, Library, InvalidTemplateLibrary
 from django.template.smartif import IfParser, Literal
 from django.template.defaultfilters import date
Index: django/template/context.py
===================================================================
--- django/template/context.py	(revision 16529)
+++ django/template/context.py	(working copy)
@@ -1,7 +1,6 @@
 from copy import copy
 from django.core.exceptions import ImproperlyConfigured
 from django.utils.importlib import import_module
-from django.http import HttpRequest
 
 # Cache of actual callables.
 _standard_context_processors = None
Index: django/template/loader_tags.py
===================================================================
--- django/template/loader_tags.py	(revision 16529)
+++ django/template/loader_tags.py	(working copy)
@@ -1,6 +1,4 @@
-from django.template.base import TemplateSyntaxError, TemplateDoesNotExist, Variable
-from django.template.base import Library, Node, TextNode
-from django.template.context import Context
+from django.template.base import TemplateSyntaxError, Library, Node, TextNode
 from django.template.defaulttags import token_kwargs
 from django.template.loader import get_template
 from django.conf import settings
Index: django/template/smartif.py
===================================================================
--- django/template/smartif.py	(revision 16529)
+++ django/template/smartif.py	(working copy)
@@ -1,7 +1,6 @@
 """
 Parser and utilities for the smart 'if' tag
 """
-import operator
 
 # Using a simple top down parser, as described here:
 #    http://effbot.org/zone/simple-top-down-parsing.htm.
Index: django/template/debug.py
===================================================================
--- django/template/debug.py	(revision 16529)
+++ django/template/debug.py	(working copy)
@@ -1,4 +1,3 @@
-from django.conf import settings
 from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
 from django.utils.encoding import force_unicode
 from django.utils.html import escape
Index: django/middleware/http.py
===================================================================
--- django/middleware/http.py	(revision 16529)
+++ django/middleware/http.py	(working copy)
@@ -1,4 +1,3 @@
-from django.core.exceptions import MiddlewareNotUsed
 from django.utils.http import http_date, parse_http_date_safe
 
 class ConditionalGetMiddleware(object):
Index: tests/modeltests/field_subclassing/models.py
===================================================================
--- tests/modeltests/field_subclassing/models.py	(revision 16529)
+++ tests/modeltests/field_subclassing/models.py	(working copy)
@@ -5,7 +5,7 @@
 from django.db import models
 from django.utils.encoding import force_unicode
 
-from fields import Small, SmallField, SmallerField, JSONField
+from fields import SmallField, SmallerField, JSONField
 
 
 class MyModel(models.Model):
Index: tests/modeltests/field_subclassing/fields.py
===================================================================
--- tests/modeltests/field_subclassing/fields.py	(revision 16529)
+++ tests/modeltests/field_subclassing/fields.py	(working copy)
@@ -1,4 +1,3 @@
-from django.core.exceptions import FieldError
 from django.db import models
 from django.utils import simplejson as json
 from django.utils.encoding import force_unicode
Index: tests/modeltests/proxy_models/models.py
===================================================================
--- tests/modeltests/proxy_models/models.py	(revision 16529)
+++ tests/modeltests/proxy_models/models.py	(working copy)
@@ -5,7 +5,6 @@
 providing a modified interface to the data from the base class.
 """
 
-from django.contrib.contenttypes.models import ContentType
 from django.db import models
 
 
Index: tests/modeltests/mutually_referential/tests.py
===================================================================
--- tests/modeltests/mutually_referential/tests.py	(revision 16529)
+++ tests/modeltests/mutually_referential/tests.py	(working copy)
@@ -1,5 +1,5 @@
 from django.test import TestCase
-from models import Parent, Child
+from models import Parent
 
 class MutuallyReferentialTests(TestCase):
 
Index: tests/modeltests/files/tests.py
===================================================================
--- tests/modeltests/files/tests.py	(revision 16529)
+++ tests/modeltests/files/tests.py	(working copy)
@@ -1,7 +1,6 @@
 from __future__ import with_statement
 
 import shutil
-import sys
 import tempfile
 
 from django.core.cache import cache
Index: tests/modeltests/files/models.py
===================================================================
--- tests/modeltests/files/models.py	(revision 16529)
+++ tests/modeltests/files/models.py	(working copy)
@@ -9,7 +9,6 @@
 import tempfile
 
 from django.db import models
-from django.core.files.base import ContentFile
 from django.core.files.storage import FileSystemStorage
 
 
Index: tests/modeltests/get_or_create/models.py
===================================================================
--- tests/modeltests/get_or_create/models.py	(revision 16529)
+++ tests/modeltests/get_or_create/models.py	(working copy)
@@ -6,7 +6,7 @@
 parameters.
 """
 
-from django.db import models, IntegrityError
+from django.db import models
 
 class Person(models.Model):
     first_name = models.CharField(max_length=100)
Index: tests/modeltests/unmanaged_models/tests.py
===================================================================
--- tests/modeltests/unmanaged_models/tests.py	(revision 16529)
+++ tests/modeltests/unmanaged_models/tests.py	(working copy)
@@ -1,7 +1,6 @@
 from django.test import TestCase
 from django.db import connection
-from models import Unmanaged1, Unmanaged2, Managed1
-from models import A01, A02, B01, B02, C01, C02
+from models import A01, A02, B01, B02, C01, C02, Unmanaged2, Managed1
 
 class SimpleTests(TestCase):
 
Index: tests/modeltests/custom_pk/tests.py
===================================================================
--- tests/modeltests/custom_pk/tests.py	(revision 16529)
+++ tests/modeltests/custom_pk/tests.py	(working copy)
@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
-from django.conf import settings
-from django.db import DEFAULT_DB_ALIAS, transaction, IntegrityError
+from django.db import transaction, IntegrityError
 from django.test import TestCase, skipIfDBFeature
 
 from models import Employee, Business, Bar, Foo
Index: tests/modeltests/custom_pk/models.py
===================================================================
--- tests/modeltests/custom_pk/models.py	(revision 16529)
+++ tests/modeltests/custom_pk/models.py	(working copy)
@@ -6,8 +6,7 @@
 this behavior by explicitly adding ``primary_key=True`` to a field.
 """
 
-from django.conf import settings
-from django.db import models, transaction, IntegrityError, DEFAULT_DB_ALIAS
+from django.db import models
 
 from fields import MyAutoField
 
Index: tests/modeltests/lookup/tests.py
===================================================================
--- tests/modeltests/lookup/tests.py	(revision 16529)
+++ tests/modeltests/lookup/tests.py	(working copy)
@@ -1,7 +1,6 @@
 from datetime import datetime
 from operator import attrgetter
 from django.core.exceptions import FieldError
-from django.db import connection
 from django.test import TestCase, skipUnlessDBFeature
 from models import Author, Article, Tag
 
Index: tests/modeltests/lookup/models.py
===================================================================
--- tests/modeltests/lookup/models.py	(revision 16529)
+++ tests/modeltests/lookup/models.py	(working copy)
@@ -4,8 +4,7 @@
 This demonstrates features of the database API.
 """
 
-from django.db import models, DEFAULT_DB_ALIAS, connection
-from django.conf import settings
+from django.db import models
 
 class Author(models.Model):
     name = models.CharField(max_length=100)
Index: tests/modeltests/proxy_model_inheritance/tests.py
===================================================================
--- tests/modeltests/proxy_model_inheritance/tests.py	(revision 16529)
+++ tests/modeltests/proxy_model_inheritance/tests.py	(working copy)
@@ -9,7 +9,7 @@
 import os
 import sys
 
-from django.conf import settings, Settings
+from django.conf import settings
 from django.core.management import call_command
 from django.db.models.loading import load_app
 from django.test import TransactionTestCase
Index: tests/modeltests/get_object_or_404/models.py
===================================================================
--- tests/modeltests/get_object_or_404/models.py	(revision 16529)
+++ tests/modeltests/get_object_or_404/models.py	(working copy)
@@ -11,8 +11,6 @@
 """
 
 from django.db import models
-from django.http import Http404
-from django.shortcuts import get_object_or_404, get_list_or_404
 
 class Author(models.Model):
     name = models.CharField(max_length=50)
Index: tests/modeltests/delete/models.py
===================================================================
--- tests/modeltests/delete/models.py	(revision 16529)
+++ tests/modeltests/delete/models.py	(working copy)
@@ -1,4 +1,4 @@
-from django.db import models, IntegrityError
+from django.db import models
 
 
 class R(models.Model):
Index: tests/modeltests/fixtures_model_package/models/__init__.py
===================================================================
--- tests/modeltests/fixtures_model_package/models/__init__.py	(revision 16529)
+++ tests/modeltests/fixtures_model_package/models/__init__.py	(working copy)
@@ -1,5 +1,4 @@
 from django.db import models
-from django.conf import settings
 
 class Article(models.Model):
     headline = models.CharField(max_length=100, default='Default headline')
Index: tests/modeltests/model_forms/models.py
===================================================================
--- tests/modeltests/model_forms/models.py	(revision 16529)
+++ tests/modeltests/model_forms/models.py	(working copy)
@@ -7,7 +7,6 @@
 words, most of these tests should be rewritten.
 """
 
-import os
 import tempfile
 
 from django.db import models
Index: tests/modeltests/many_to_one/tests.py
===================================================================
--- tests/modeltests/many_to_one/tests.py	(revision 16529)
+++ tests/modeltests/many_to_one/tests.py	(working copy)
@@ -2,7 +2,7 @@
 from datetime import datetime
 
 from django.test import TestCase
-from django.core.exceptions import FieldError, MultipleObjectsReturned
+from django.core.exceptions import MultipleObjectsReturned
 
 from models import Article, Reporter
 
Index: tests/modeltests/basic/tests.py
===================================================================
--- tests/modeltests/basic/tests.py	(revision 16529)
+++ tests/modeltests/basic/tests.py	(working copy)
@@ -1,7 +1,6 @@
 from datetime import datetime
 
 from django.core.exceptions import ObjectDoesNotExist
-from django.db import models, DEFAULT_DB_ALIAS, connection
 from django.db.models.fields import FieldDoesNotExist
 from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
 
Index: tests/modeltests/basic/models.py
===================================================================
--- tests/modeltests/basic/models.py	(revision 16529)
+++ tests/modeltests/basic/models.py	(working copy)
@@ -4,7 +4,7 @@
 
 This is a basic model with only two non-primary-key fields.
 """
-from django.db import models, DEFAULT_DB_ALIAS, connection
+from django.db import models
 
 class Article(models.Model):
     headline = models.CharField(max_length=100, default='Default headline')
Index: tests/modeltests/force_insert_update/models.py
===================================================================
--- tests/modeltests/force_insert_update/models.py	(revision 16529)
+++ tests/modeltests/force_insert_update/models.py	(working copy)
@@ -2,7 +2,7 @@
 Tests for forcing insert and update queries (instead of Django's normal
 automatic behaviour).
 """
-from django.db import models, transaction, IntegrityError
+from django.db import models
 
 class Counter(models.Model):
     name = models.CharField(max_length = 10)
Index: tests/modeltests/one_to_one/models.py
===================================================================
--- tests/modeltests/one_to_one/models.py	(revision 16529)
+++ tests/modeltests/one_to_one/models.py	(working copy)
@@ -6,7 +6,7 @@
 In this example, a ``Place`` optionally can be a ``Restaurant``.
 """
 
-from django.db import models, transaction, IntegrityError
+from django.db import models
 
 class Place(models.Model):
     name = models.CharField(max_length=50)
Index: tests/modeltests/validation/validators.py
===================================================================
--- tests/modeltests/validation/validators.py	(revision 16529)
+++ tests/modeltests/validation/validators.py	(working copy)
@@ -1,5 +1,3 @@
-from django.utils.unittest import TestCase
-
 from modeltests.validation import ValidationTestCase
 from models import *
 
Index: tests/modeltests/validation/models.py
===================================================================
--- tests/modeltests/validation/models.py	(revision 16529)
+++ tests/modeltests/validation/models.py	(working copy)
@@ -1,7 +1,6 @@
 from datetime import datetime
 from django.core.exceptions import ValidationError
 from django.db import models
-from django.test import TestCase
 
 
 def validate_answer_to_universe(value):
Index: tests/modeltests/validation/test_unique.py
===================================================================
--- tests/modeltests/validation/test_unique.py	(revision 16529)
+++ tests/modeltests/validation/test_unique.py	(working copy)
@@ -2,9 +2,7 @@
 
 import datetime
 
-from django.conf import settings
 from django.core.exceptions import ValidationError
-from django.db import connection
 from django.test import TestCase
 from django.utils import unittest
 
Index: tests/modeltests/m2m_through/tests.py
===================================================================
--- tests/modeltests/m2m_through/tests.py	(revision 16529)
+++ tests/modeltests/m2m_through/tests.py	(working copy)
@@ -3,8 +3,8 @@
 
 from django.test import TestCase
 
-from models import Person, Group, Membership, CustomMembership, \
-    TestNoDefaultsOrNulls, PersonSelfRefM2M, Friendship
+from models import (Person, Group, Membership, CustomMembership,
+    PersonSelfRefM2M, Friendship)
 
 
 class M2mThroughTests(TestCase):
Index: tests/modeltests/transactions/tests.py
===================================================================
--- tests/modeltests/transactions/tests.py	(revision 16529)
+++ tests/modeltests/transactions/tests.py	(working copy)
@@ -1,9 +1,6 @@
 from __future__ import with_statement
 
-import sys
-
-from django.db import connection, transaction, IntegrityError, DEFAULT_DB_ALIAS
-from django.conf import settings
+from django.db import connection, transaction, IntegrityError
 from django.test import TransactionTestCase, skipUnlessDBFeature
 
 from models import Reporter
Index: tests/modeltests/transactions/models.py
===================================================================
--- tests/modeltests/transactions/models.py	(revision 16529)
+++ tests/modeltests/transactions/models.py	(working copy)
@@ -7,7 +7,7 @@
 manually.
 """
 
-from django.db import models, DEFAULT_DB_ALIAS
+from django.db import models
 
 class Reporter(models.Model):
     first_name = models.CharField(max_length=30)
Index: tests/modeltests/model_formsets/tests.py
===================================================================
--- tests/modeltests/model_formsets/tests.py	(revision 16529)
+++ tests/modeltests/model_formsets/tests.py	(working copy)
@@ -10,7 +10,7 @@
 from django.test import TestCase, skipUnlessDBFeature
 
 from modeltests.model_formsets.models import (
-    Author, BetterAuthor, Book, BookWithCustomPK, Editor,
+    Author, BetterAuthor, Book, BookWithCustomPK,
     BookWithOptionalAltEditor, AlternateBook, AuthorMeeting, CustomPrimaryKey,
     Place, Owner, Location, OwnerProfile, Restaurant, Product, Price,
     MexicanRestaurant, ClassyMexicanRestaurant, Repository, Revision,
Index: tests/modeltests/pagination/tests.py
===================================================================
--- tests/modeltests/pagination/tests.py	(revision 16529)
+++ tests/modeltests/pagination/tests.py	(working copy)
@@ -1,5 +1,4 @@
 from datetime import datetime
-from operator import attrgetter
 
 from django.core.paginator import Paginator, InvalidPage, EmptyPage
 from django.test import TestCase
Index: tests/modeltests/serializers/tests.py
===================================================================
--- tests/modeltests/serializers/tests.py	(revision 16529)
+++ tests/modeltests/serializers/tests.py	(working copy)
@@ -9,8 +9,7 @@
 from django.test import TestCase, TransactionTestCase, Approximate
 from django.utils import simplejson, unittest
 
-from models import Category, Author, Article, AuthorProfile, Actor, \
-                                    Movie, Score, Player, Team
+from models import Category, Author, Article, AuthorProfile, Actor, Movie, Score, Player, Team
 
 class SerializerRegistrationTests(unittest.TestCase):
     def setUp(self):
Index: tests/modeltests/fixtures/tests.py
===================================================================
--- tests/modeltests/fixtures/tests.py	(revision 16529)
+++ tests/modeltests/fixtures/tests.py	(working copy)
@@ -1,13 +1,10 @@
 import StringIO
-import sys
 
-from django.conf import settings
 from django.contrib.sites.models import Site
 from django.core import management
-from django.db import DEFAULT_DB_ALIAS
 from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
 
-from models import Article, Blog, Book, Category, Person, Spy, Tag, Visa
+from models import Article, Book, Spy, Tag, Visa
 
 
 class TestCaseFixtureLoadingTests(TestCase):
Index: tests/modeltests/fixtures/models.py
===================================================================
--- tests/modeltests/fixtures/models.py	(revision 16529)
+++ tests/modeltests/fixtures/models.py	(working copy)
@@ -11,8 +11,7 @@
 from django.contrib.auth.models import Permission
 from django.contrib.contenttypes import generic
 from django.contrib.contenttypes.models import ContentType
-from django.db import models, DEFAULT_DB_ALIAS
-from django.conf import settings
+from django.db import models
 
 
 class Category(models.Model):
Index: tests/regressiontests/defer_regress/tests.py
===================================================================
--- tests/regressiontests/defer_regress/tests.py	(revision 16529)
+++ tests/regressiontests/defer_regress/tests.py	(working copy)
@@ -1,9 +1,7 @@
 from operator import attrgetter
 
-from django.conf import settings
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.sessions.backends.db import SessionStore
-from django.db import connection
 from django.db.models import Count
 from django.db.models.loading import cache
 from django.test import TestCase
Index: tests/regressiontests/defer_regress/models.py
===================================================================
--- tests/regressiontests/defer_regress/models.py	(revision 16529)
+++ tests/regressiontests/defer_regress/models.py	(working copy)
@@ -2,9 +2,7 @@
 Regression tests for defer() / only() behavior.
 """
 
-from django.conf import settings
-from django.contrib.contenttypes.models import ContentType
-from django.db import connection, models
+from django.db import models
 
 class Item(models.Model):
     name = models.CharField(max_length=15)
Index: tests/regressiontests/admin_filters/tests.py
===================================================================
--- tests/regressiontests/admin_filters/tests.py	(revision 16529)
+++ tests/regressiontests/admin_filters/tests.py	(working copy)
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
 import datetime
 
 from django.core.exceptions import ImproperlyConfigured
Index: tests/regressiontests/test_utils/tests.py
===================================================================
--- tests/regressiontests/test_utils/tests.py	(revision 16529)
+++ tests/regressiontests/test_utils/tests.py	(working copy)
@@ -1,8 +1,6 @@
 from __future__ import with_statement
 
-import sys
-
-from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
+from django.test import TestCase, skipUnlessDBFeature
 from django.utils.unittest import skip
 
 from models import Person
Index: tests/regressiontests/cache/tests.py
===================================================================
--- tests/regressiontests/cache/tests.py	(revision 16529)
+++ tests/regressiontests/cache/tests.py	(working copy)
@@ -2,7 +2,6 @@
 
 # Unit tests for cache framework
 # Uses whatever cache backend is set in the test settings file.
-from __future__ import with_statement
 
 import hashlib
 import os
Index: tests/regressiontests/multiple_database/models.py
===================================================================
--- tests/regressiontests/multiple_database/models.py	(revision 16529)
+++ tests/regressiontests/multiple_database/models.py	(working copy)
@@ -1,4 +1,3 @@
-from django.conf import settings
 from django.contrib.auth.models import User
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes import generic
Index: tests/regressiontests/select_related_onetoone/tests.py
===================================================================
--- tests/regressiontests/select_related_onetoone/tests.py	(revision 16529)
+++ tests/regressiontests/select_related_onetoone/tests.py	(working copy)
@@ -1,5 +1,3 @@
-from django import db
-from django.conf import settings
 from django.test import TestCase
 
 from models import (User, UserProfile, UserStat, UserStatResult, StatDetails,
Index: tests/regressiontests/delete_regress/tests.py
===================================================================
--- tests/regressiontests/delete_regress/tests.py	(revision 16529)
+++ tests/regressiontests/delete_regress/tests.py	(working copy)
@@ -1,11 +1,11 @@
 import datetime
 
 from django.conf import settings
-from django.db import backend, connection, transaction, DEFAULT_DB_ALIAS
+from django.db import backend, transaction, DEFAULT_DB_ALIAS
 from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
 
 from models import (Book, Award, AwardNote, Person, Child, Toy, PlayedWith,
-    PlayedWithNote, Contact, Email, Researcher, Food, Eaten,
+    PlayedWithNote, Email, Researcher, Food, Eaten,
     Policy, Version, Location, Item)
 
 
Index: tests/regressiontests/views/tests/debug.py
===================================================================
--- tests/regressiontests/views/tests/debug.py	(revision 16529)
+++ tests/regressiontests/views/tests/debug.py	(working copy)
@@ -9,7 +9,6 @@
 from django.core.urlresolvers import reverse
 from django.template import TemplateSyntaxError
 from django.views.debug import ExceptionReporter
-from django.core.exceptions import ImproperlyConfigured
 from django.core import mail
 
 from regressiontests.views import BrokenException, except_args
Index: tests/regressiontests/views/tests/defaults.py
===================================================================
--- tests/regressiontests/views/tests/defaults.py	(revision 16529)
+++ tests/regressiontests/views/tests/defaults.py	(working copy)
@@ -1,6 +1,3 @@
-from os import path
-
-from django.conf import settings
 from django.test import TestCase
 from django.contrib.contenttypes.models import ContentType
 
Index: tests/regressiontests/model_forms_regress/tests.py
===================================================================
--- tests/regressiontests/model_forms_regress/tests.py	(revision 16529)
+++ tests/regressiontests/model_forms_regress/tests.py	(working copy)
@@ -8,8 +8,8 @@
 from django.utils import unittest
 from django.test import TestCase
 
-from models import Person, RealPerson, Triple, FilePathModel, Article, \
-    Publication, CustomFF, Author, Author1, Homepage, Document, Edition
+from models import (Person, RealPerson, Triple, FilePathModel, Article,
+    Publication, CustomFF, Author, Author1, Homepage, Document, Edition)
 
 
 class ModelMultipleChoiceFieldTests(TestCase):
Index: tests/regressiontests/admin_validation/tests.py
===================================================================
--- tests/regressiontests/admin_validation/tests.py	(revision 16529)
+++ tests/regressiontests/admin_validation/tests.py	(working copy)
@@ -1,7 +1,6 @@
 from django.contrib import admin
 from django import forms
-from django.contrib.admin.validation import validate, validate_inline, \
-                                            ImproperlyConfigured
+from django.contrib.admin.validation import validate, validate_inline, ImproperlyConfigured
 from django.test import TestCase
 
 from models import Song, Book, Album, TwoAlbumFKAndAnE, State, City
Index: tests/regressiontests/file_storage/tests.py
===================================================================
--- tests/regressiontests/file_storage/tests.py	(revision 16529)
+++ tests/regressiontests/file_storage/tests.py	(working copy)
@@ -18,7 +18,7 @@
 
 from django.conf import settings
 from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
-from django.core.files.base import ContentFile, File
+from django.core.files.base import ContentFile
 from django.core.files.images import get_image_dimensions
 from django.core.files.storage import FileSystemStorage, get_storage_class
 from django.core.files.uploadedfile import UploadedFile
Index: tests/regressiontests/file_uploads/tests.py
===================================================================
--- tests/regressiontests/file_uploads/tests.py	(revision 16529)
+++ tests/regressiontests/file_uploads/tests.py	(working copy)
@@ -9,7 +9,7 @@
 
 from django.core.files import temp as tempfile
 from django.core.files.uploadedfile import SimpleUploadedFile
-from django.http.multipartparser import MultiPartParser, MultiPartParserError
+from django.http.multipartparser import MultiPartParser
 from django.test import TestCase, client
 from django.utils import simplejson
 from django.utils import unittest
Index: tests/regressiontests/expressions_regress/tests.py
===================================================================
--- tests/regressiontests/expressions_regress/tests.py	(revision 16529)
+++ tests/regressiontests/expressions_regress/tests.py	(working copy)
@@ -3,8 +3,7 @@
 """
 import datetime
 
-from django.conf import settings
-from django.db import models, connection
+from django.db import connection
 from django.db.models import F
 from django.test import TestCase, Approximate, skipUnlessDBFeature
 
Index: tests/regressiontests/syndication/tests.py
===================================================================
--- tests/regressiontests/syndication/tests.py	(revision 16529)
+++ tests/regressiontests/syndication/tests.py	(working copy)
@@ -1,5 +1,3 @@
-import datetime
-import warnings
 from xml.dom import minidom
 
 from django.contrib.syndication import views
Index: tests/regressiontests/comment_tests/tests/templatetag_tests.py
===================================================================
--- tests/regressiontests/comment_tests/tests/templatetag_tests.py	(revision 16529)
+++ tests/regressiontests/comment_tests/tests/templatetag_tests.py	(working copy)
@@ -1,5 +1,4 @@
 from django.contrib.comments.forms import CommentForm
-from django.contrib.comments.models import Comment
 from django.contrib.contenttypes.models import ContentType
 from django.template import Template, Context
 from regressiontests.comment_tests.models import Article, Author
Index: tests/regressiontests/comment_tests/tests/comment_utils_moderators_tests.py
===================================================================
--- tests/regressiontests/comment_tests/tests/comment_utils_moderators_tests.py	(revision 16529)
+++ tests/regressiontests/comment_tests/tests/comment_utils_moderators_tests.py	(working copy)
@@ -1,5 +1,4 @@
-from regressiontests.comment_tests.tests import CommentTestCase, CT, Site
-from django.contrib.comments.forms import CommentForm
+from regressiontests.comment_tests.tests import CommentTestCase
 from django.contrib.comments.models import Comment
 from django.contrib.comments.moderation import moderator, CommentModerator, AlreadyModerated
 from regressiontests.comment_tests.models import Entry
Index: tests/regressiontests/comment_tests/tests/feed_tests.py
===================================================================
--- tests/regressiontests/comment_tests/tests/feed_tests.py	(revision 16529)
+++ tests/regressiontests/comment_tests/tests/feed_tests.py	(working copy)
@@ -1,7 +1,3 @@
-import warnings
-
-from django.test.utils import get_warnings_state, restore_warnings_state
-
 from regressiontests.comment_tests.tests import CommentTestCase
 
 
Index: tests/regressiontests/comment_tests/models.py
===================================================================
--- tests/regressiontests/comment_tests/models.py	(revision 16529)
+++ tests/regressiontests/comment_tests/models.py	(working copy)
@@ -30,5 +30,5 @@
         return self.title
 
 class Book(models.Model):
-    dewey_decimal = models.DecimalField(primary_key = True, decimal_places=2, max_digits=5)
+    dewey_decimal = models.DecimalField(primary_key=True, decimal_places=2, max_digits=5)
     
\ No newline at end of file
Index: tests/regressiontests/m2m_through_regress/models.py
===================================================================
--- tests/regressiontests/m2m_through_regress/models.py	(revision 16529)
+++ tests/regressiontests/m2m_through_regress/models.py	(working copy)
@@ -1,7 +1,4 @@
-from datetime import datetime
-
 from django.contrib.auth.models import User
-from django.core import management
 from django.db import models
 
 
Index: tests/regressiontests/signals_regress/tests.py
===================================================================
--- tests/regressiontests/signals_regress/tests.py	(revision 16529)
+++ tests/regressiontests/signals_regress/tests.py	(working copy)
@@ -1,5 +1,3 @@
-import sys
-from StringIO import StringIO
 from django.test import TestCase
 
 from django.db import models
Index: tests/regressiontests/datatypes/tests.py
===================================================================
--- tests/regressiontests/datatypes/tests.py	(revision 16529)
+++ tests/regressiontests/datatypes/tests.py	(working copy)
@@ -1,7 +1,5 @@
 import datetime
 
-from django.conf import settings
-from django.db import DEFAULT_DB_ALIAS
 from django.test import TestCase, skipIfDBFeature
 from django.utils import tzinfo
 
Index: tests/regressiontests/localflavor/tests.py
===================================================================
--- tests/regressiontests/localflavor/tests.py	(revision 16529)
+++ tests/regressiontests/localflavor/tests.py	(working copy)
@@ -1,7 +1,3 @@
-from django.test import TestCase
-from django.utils import unittest
-
-# just import your tests here
 from au.tests import *
 from mk.tests import *
 from us.tests import *
Index: tests/regressiontests/modeladmin/models.py
===================================================================
--- tests/regressiontests/modeladmin/models.py	(revision 16529)
+++ tests/regressiontests/modeladmin/models.py	(working copy)
@@ -1,6 +1,4 @@
 # coding: utf-8
-from datetime import date
-
 from django.db import models
 from django.contrib.auth.models import User
 
Index: tests/regressiontests/max_lengths/tests.py
===================================================================
--- tests/regressiontests/max_lengths/tests.py	(revision 16529)
+++ tests/regressiontests/max_lengths/tests.py	(working copy)
@@ -1,4 +1,3 @@
-from django.db import DatabaseError
 from django.utils import unittest
 from regressiontests.max_lengths.models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
 
Index: tests/regressiontests/extra_regress/tests.py
===================================================================
--- tests/regressiontests/extra_regress/tests.py	(revision 16529)
+++ tests/regressiontests/extra_regress/tests.py	(working copy)
@@ -3,8 +3,7 @@
 from django.utils.datastructures import SortedDict
 
 from django.contrib.auth.models import User
-from regressiontests.extra_regress.models import TestObject, Order, \
-        RevisionableModel
+from regressiontests.extra_regress.models import TestObject, Order, RevisionableModel
 
 import datetime
 
Index: tests/regressiontests/middleware_exceptions/models.py
===================================================================
--- tests/regressiontests/middleware_exceptions/models.py	(revision 16529)
+++ tests/regressiontests/middleware_exceptions/models.py	(working copy)
@@ -1 +0,0 @@
-from django.db import models
Index: tests/regressiontests/i18n/patterns/urls/wrong_namespace.py
===================================================================
--- tests/regressiontests/i18n/patterns/urls/wrong_namespace.py	(revision 16529)
+++ tests/regressiontests/i18n/patterns/urls/wrong_namespace.py	(working copy)
@@ -1,4 +1,4 @@
-from django.conf.urls.defaults import include, url
+from django.conf.urls.defaults import url
 from django.conf.urls.i18n import i18n_patterns
 from django.utils.translation import ugettext_lazy as _
 from django.views.generic import TemplateView
Index: tests/regressiontests/i18n/patterns/urls/namespace.py
===================================================================
--- tests/regressiontests/i18n/patterns/urls/namespace.py	(revision 16529)
+++ tests/regressiontests/i18n/patterns/urls/namespace.py	(working copy)
@@ -1,4 +1,4 @@
-from django.conf.urls.defaults import patterns, include, url
+from django.conf.urls.defaults import patterns, url
 from django.utils.translation import ugettext_lazy as _
 from django.views.generic import TemplateView
 
Index: tests/regressiontests/i18n/patterns/urls/wrong.py
===================================================================
--- tests/regressiontests/i18n/patterns/urls/wrong.py	(revision 16529)
+++ tests/regressiontests/i18n/patterns/urls/wrong.py	(working copy)
@@ -1,4 +1,4 @@
-from django.conf.urls.defaults import patterns, include, url
+from django.conf.urls.defaults import include, url
 from django.conf.urls.i18n import i18n_patterns
 from django.utils.translation import ugettext_lazy as _
 
Index: tests/regressiontests/i18n/forms.py
===================================================================
--- tests/regressiontests/i18n/forms.py	(revision 16529)
+++ tests/regressiontests/i18n/forms.py	(working copy)
@@ -1,5 +1,6 @@
-from django import template, forms
+from django import forms
 from django.forms.extras import SelectDateWidget
+
 from models import Company
 
 class I18nForm(forms.Form):
Index: tests/regressiontests/csrf_tests/tests.py
===================================================================
--- tests/regressiontests/csrf_tests/tests.py	(revision 16529)
+++ tests/regressiontests/csrf_tests/tests.py	(working copy)
@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
 from __future__ import with_statement
-import warnings
 
 from django.test import TestCase
 from django.http import HttpRequest, HttpResponse
Index: tests/regressiontests/model_fields/tests.py
===================================================================
--- tests/regressiontests/model_fields/tests.py	(revision 16529)
+++ tests/regressiontests/model_fields/tests.py	(working copy)
@@ -12,14 +12,14 @@
 
 # If PIL available, do these tests.
 if Image:
-    from imagefield import \
-            ImageFieldTests, \
-            ImageFieldTwoDimensionsTests, \
-            ImageFieldNoDimensionsTests, \
-            ImageFieldOneDimensionTests, \
-            ImageFieldDimensionsFirstTests, \
-            ImageFieldUsingFileTests, \
-            TwoImageFieldTests
+    from imagefield import (
+            ImageFieldTests,
+            ImageFieldTwoDimensionsTests,
+            ImageFieldNoDimensionsTests,
+            ImageFieldOneDimensionTests,
+            ImageFieldDimensionsFirstTests,
+            ImageFieldUsingFileTests,
+            TwoImageFieldTests)
 
 
 class BasicFieldTests(test.TestCase):
Index: tests/regressiontests/model_fields/imagefield.py
===================================================================
--- tests/regressiontests/model_fields/imagefield.py	(revision 16529)
+++ tests/regressiontests/model_fields/imagefield.py	(working copy)
@@ -2,12 +2,11 @@
 import shutil
 
 from django.core.files import File
-from django.core.files.base import ContentFile
 from django.core.files.images import ImageFile
 from django.test import TestCase
 
-from models import Image, Person, PersonWithHeight, PersonWithHeightAndWidth, \
-        PersonDimensionsFirst, PersonTwoImages, TestImageFieldFile
+from models import (Image, Person, PersonWithHeight, PersonWithHeightAndWidth,
+        PersonDimensionsFirst, PersonTwoImages, TestImageFieldFile)
 
 
 # If PIL available, do these tests.
Index: tests/regressiontests/generic_relations_regress/tests.py
===================================================================
--- tests/regressiontests/generic_relations_regress/tests.py	(revision 16529)
+++ tests/regressiontests/generic_relations_regress/tests.py	(working copy)
@@ -1,5 +1,4 @@
 from django.test import TestCase
-from django.contrib.contenttypes.models import ContentType
 from django.db.models import Q
 from models import *
 
Index: tests/regressiontests/forms/tests/media.py
===================================================================
--- tests/regressiontests/forms/tests/media.py	(revision 16529)
+++ tests/regressiontests/forms/tests/media.py	(working copy)
@@ -1,5 +1,4 @@
 # -*- coding: utf-8 -*-
-from django.conf import settings
 from django.forms import TextInput, Media, TextInput, CharField, Form, MultiWidget
 from django.test import TestCase
 from django.test.utils import override_settings
Index: tests/regressiontests/forms/tests/models.py
===================================================================
--- tests/regressiontests/forms/tests/models.py	(revision 16529)
+++ tests/regressiontests/forms/tests/models.py	(working copy)
@@ -3,7 +3,8 @@
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.forms import Form, ModelForm, FileField, ModelChoiceField
 from django.test import TestCase
-from regressiontests.forms.models import ChoiceModel, ChoiceOptionModel, ChoiceFieldModel, FileModel, Group, BoundaryModel, Defaults
+from regressiontests.forms.models import (ChoiceOptionModel, ChoiceFieldModel,
+    FileModel, Group, BoundaryModel, Defaults)
 
 
 class ChoiceFieldForm(ModelForm):
Index: tests/regressiontests/forms/tests/fields.py
===================================================================
--- tests/regressiontests/forms/tests/fields.py	(revision 16529)
+++ tests/regressiontests/forms/tests/fields.py	(working copy)
@@ -33,7 +33,6 @@
 
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.forms import *
-from django.forms.widgets import RadioFieldRenderer
 from django.utils.unittest import TestCase
 
 
Index: tests/regressiontests/forms/tests/forms.py
===================================================================
--- tests/regressiontests/forms/tests/forms.py	(revision 16529)
+++ tests/regressiontests/forms/tests/forms.py	(working copy)
@@ -1,8 +1,5 @@
 # -*- coding: utf-8 -*-
 import datetime
-from decimal import Decimal
-import re
-import time
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.forms import *
 from django.http import QueryDict
Index: tests/regressiontests/forms/tests/widgets.py
===================================================================
--- tests/regressiontests/forms/tests/widgets.py	(revision 16529)
+++ tests/regressiontests/forms/tests/widgets.py	(working copy)
@@ -2,9 +2,6 @@
 
 import copy
 import datetime
-import re
-import time
-from decimal import Decimal
 from django.conf import settings
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.forms import *
Index: tests/regressiontests/forms/localflavor/in_.py
===================================================================
--- tests/regressiontests/forms/localflavor/in_.py	(revision 16529)
+++ tests/regressiontests/forms/localflavor/in_.py	(working copy)
@@ -1,5 +1,3 @@
-import warnings
-
 from django.contrib.localflavor.in_.forms import (INZipCodeField,
     INStateField, INStateSelect, INPhoneNumberField)
 
Index: tests/regressiontests/forms/localflavor/cl.py
===================================================================
--- tests/regressiontests/forms/localflavor/cl.py	(revision 16529)
+++ tests/regressiontests/forms/localflavor/cl.py	(working copy)
@@ -1,5 +1,4 @@
 from django.contrib.localflavor.cl.forms import CLRutField, CLRegionSelect
-from django.core.exceptions import ValidationError
 
 from utils import LocalFlavorTestCase
 
Index: tests/regressiontests/serializers_regress/tests.py
===================================================================
--- tests/regressiontests/serializers_regress/tests.py	(revision 16529)
+++ tests/regressiontests/serializers_regress/tests.py	(working copy)
@@ -15,10 +15,9 @@
 except ImportError:
     from StringIO import StringIO
 
-from django.conf import settings
-from django.core import serializers, management
+from django.core import serializers
 from django.core.serializers import SerializerDoesNotExist
-from django.db import transaction, DEFAULT_DB_ALIAS, connection
+from django.db import connection
 from django.test import TestCase
 from django.utils.functional import curry
 
Index: tests/regressiontests/generic_views/base.py
===================================================================
--- tests/regressiontests/generic_views/base.py	(revision 16529)
+++ tests/regressiontests/generic_views/base.py	(working copy)
@@ -4,7 +4,6 @@
 from django.core.exceptions import ImproperlyConfigured
 from django.http import HttpResponse
 from django.test import TestCase, RequestFactory
-from django.utils import simplejson
 from django.views.generic import View, TemplateView, RedirectView
 
 
Index: tests/regressiontests/generic_views/list.py
===================================================================
--- tests/regressiontests/generic_views/list.py	(revision 16529)
+++ tests/regressiontests/generic_views/list.py	(working copy)
@@ -2,7 +2,6 @@
 from django.test import TestCase
 
 from regressiontests.generic_views.models import Author, Artist
-from regressiontests.generic_views.views import CustomPaginator
 
 class ListViewTests(TestCase):
     fixtures = ['generic-views-test-data.json']
Index: tests/regressiontests/generic_views/dates.py
===================================================================
--- tests/regressiontests/generic_views/dates.py	(revision 16529)
+++ tests/regressiontests/generic_views/dates.py	(working copy)
@@ -1,5 +1,4 @@
 import datetime
-import random
 
 from django.core.exceptions import ImproperlyConfigured
 from django.test import TestCase
Index: tests/regressiontests/templates/loaders.py
===================================================================
--- tests/regressiontests/templates/loaders.py	(revision 16529)
+++ tests/regressiontests/templates/loaders.py	(working copy)
@@ -14,12 +14,10 @@
 import imp
 import StringIO
 import os.path
-import warnings
 
 from django.template import TemplateDoesNotExist, Context
 from django.template.loaders.eggs import Loader as EggLoader
 from django.template import loader
-from django.test.utils import get_warnings_state, restore_warnings_state
 from django.utils import unittest
 
 
Index: tests/regressiontests/templates/response.py
===================================================================
--- tests/regressiontests/templates/response.py	(revision 16529)
+++ tests/regressiontests/templates/response.py	(working copy)
@@ -6,7 +6,7 @@
 from django.test import RequestFactory, TestCase
 from django.conf import settings
 import django.template.context
-from django.template import Template, Context, RequestContext
+from django.template import Template, Context
 from django.template.response import (TemplateResponse, SimpleTemplateResponse,
                                       ContentNotRenderedError)
 
Index: tests/regressiontests/templates/tests.py
===================================================================
--- tests/regressiontests/templates/tests.py	(revision 16529)
+++ tests/regressiontests/templates/tests.py	(working copy)
@@ -15,12 +15,12 @@
 from urlparse import urljoin
 
 from django import template
-from django.template import base as template_base
+from django.template import base as template_base, RequestContext
 from django.core import urlresolvers
 from django.template import loader
 from django.template.loaders import app_directories, filesystem, cached
-from django.test.utils import get_warnings_state, restore_warnings_state,\
-    setup_test_template_loader, restore_template_loaders
+from django.test.utils import (get_warnings_state, restore_warnings_state,
+    setup_test_template_loader, restore_template_loaders)
 from django.utils import unittest
 from django.utils.formats import date_format
 from django.utils.translation import activate, deactivate, ugettext as _
Index: tests/regressiontests/templates/smartif.py
===================================================================
--- tests/regressiontests/templates/smartif.py	(revision 16529)
+++ tests/regressiontests/templates/smartif.py	(working copy)
@@ -1,4 +1,4 @@
-from django.template.smartif import IfParser, Literal
+from django.template.smartif import IfParser
 from django.utils import unittest
 
 class SmartIfTests(unittest.TestCase):
Index: tests/regressiontests/templates/custom.py
===================================================================
--- tests/regressiontests/templates/custom.py	(revision 16529)
+++ tests/regressiontests/templates/custom.py	(working copy)
@@ -1,5 +1,3 @@
-from __future__ import with_statement
-
 from django import template
 from django.utils.unittest import TestCase
 from templatetags import custom
Index: tests/regressiontests/introspection/tests.py
===================================================================
--- tests/regressiontests/introspection/tests.py	(revision 16529)
+++ tests/regressiontests/introspection/tests.py	(working copy)
@@ -1,6 +1,5 @@
 from functools import update_wrapper
-from django.conf import settings
-from django.db import connection, DEFAULT_DB_ALIAS
+from django.db import connection
 from django.test import TestCase, skipUnlessDBFeature
 
 from models import Reporter, Article
Index: tests/regressiontests/utils/jslex.py
===================================================================
--- tests/regressiontests/utils/jslex.py	(revision 16529)
+++ tests/regressiontests/utils/jslex.py	(working copy)
@@ -2,7 +2,6 @@
 # encoding: utf-8
 # originally from https://bitbucket.org/ned/jslex
 
-import difflib
 from django.test import TestCase
 from django.utils.jslex import JsLexer, prepare_js_for_gettext
 
Index: tests/regressiontests/fixtures_regress/tests.py
===================================================================
--- tests/regressiontests/fixtures_regress/tests.py	(revision 16529)
+++ tests/regressiontests/fixtures_regress/tests.py	(working copy)
@@ -2,7 +2,6 @@
 # Unittests for fixtures.
 import os
 import re
-import sys
 try:
     from cStringIO import StringIO
 except ImportError:
@@ -13,8 +12,8 @@
 from django.core.management.base import CommandError
 from django.db.models import signals
 from django.db import transaction
-from django.test import TestCase, TransactionTestCase, skipIfDBFeature, \
-    skipUnlessDBFeature
+from django.test import (TestCase, TransactionTestCase, skipIfDBFeature,
+    skipUnlessDBFeature)
 
 from models import Animal, Stuff
 from models import Absolute, Parent, Child
Index: tests/regressiontests/fixtures_regress/models.py
===================================================================
--- tests/regressiontests/fixtures_regress/models.py	(revision 16529)
+++ tests/regressiontests/fixtures_regress/models.py	(working copy)
@@ -1,6 +1,5 @@
-from django.db import models, DEFAULT_DB_ALIAS, connection
+from django.db import models
 from django.contrib.auth.models import User
-from django.conf import settings
 
 
 class Animal(models.Model):
Index: tests/regressiontests/bash_completion/management/commands/test_command.py
===================================================================
--- tests/regressiontests/bash_completion/management/commands/test_command.py	(revision 16529)
+++ tests/regressiontests/bash_completion/management/commands/test_command.py	(working copy)
@@ -1,5 +1,4 @@
-import sys, os
-from optparse import OptionParser, make_option
+from optparse import make_option
 
 from django.core.management.base import BaseCommand
 
Index: tests/regressiontests/urlpatterns_reverse/tests.py
===================================================================
--- tests/regressiontests/urlpatterns_reverse/tests.py	(revision 16529)
+++ tests/regressiontests/urlpatterns_reverse/tests.py	(working copy)
@@ -3,9 +3,8 @@
 """
 from django.conf import settings
 from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
-from django.core.urlresolvers import reverse, resolve, NoReverseMatch,\
-                                     Resolver404, ResolverMatch,\
-                                     RegexURLResolver, RegexURLPattern
+from django.core.urlresolvers import (reverse, resolve, NoReverseMatch,
+    Resolver404, ResolverMatch, RegexURLResolver, RegexURLPattern)
 from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
 from django.shortcuts import redirect
 from django.test import TestCase
Index: tests/regressiontests/urlpatterns_reverse/middleware.py
===================================================================
--- tests/regressiontests/urlpatterns_reverse/middleware.py	(revision 16529)
+++ tests/regressiontests/urlpatterns_reverse/middleware.py	(working copy)
@@ -1,5 +1,3 @@
-from django.core.urlresolvers import set_urlconf
-
 import urlconf_inner
 
 class ChangeURLconfMiddleware(object):
