  from django.contrib.gis.measure import Distance
  from django.core.exceptions import ImproperlyConfigured
  from django.db.backends.postgresql.operations import DatabaseOperations
  from django.db.utils import ProgrammingError
  from django.utils import six
  from django.utils.functional import cached_property
  
  from .adapter import PostGISAdapter
  from .models import PostGISGeometryColumns, PostGISSpatialRefSys
  from .pgraster import from_pgraster, get_pgraster_srid, to_pgraster
 
</s> remove from django.utils import six
 </s> add  </s> remove from django.utils import lru_cache, six
 </s> add from django.utils import lru_cache </s> remove from django.utils import six
 </s> add  </s> remove from django.utils import six
 </s> add  </s> remove from django.utils import six
 </s> add 
  from django.contrib.gis.measure import Distance
  from django.core.exceptions import ImproperlyConfigured
  from django.db.backends.postgresql.operations import DatabaseOperations
  from django.db.utils import ProgrammingError

  from django.utils.functional import cached_property
  
  from .adapter import PostGISAdapter
  from .models import PostGISGeometryColumns, PostGISSpatialRefSys
  from .pgraster import from_pgraster, get_pgraster_srid, to_pgraster
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/contrib/gis/db/backends/postgis/operations.py