  from django.db import models
  from django.db.models import DurationField as ModelDurationField
  from django.db.models.fields import Field as DjangoModelField
  from django.db.models.fields import FieldDoesNotExist
  from django.utils import six, timezone
  from django.utils.functional import cached_property
  from django.utils.translation import ugettext_lazy as _
  
  from rest_framework.compat import Mapping, postgres_fields, unicode_to_repr
  from rest_framework.exceptions import ErrorDetail, ValidationError
 
</s> remove from rest_framework.compat import Mapping, postgres_fields, unicode_to_repr
 </s> add from rest_framework.compat import Mapping, postgres_fields </s> remove from rest_framework.compat import unicode_to_repr
 </s> add  </s> remove from django.utils import six, translation
 </s> add from django.utils import translation </s> remove from __future__ import unicode_literals

 </s> add  </s> remove # -*- coding: utf-8 -*-
from __future__ import unicode_literals

 </s> add 
from django.utils import timezone
  from django.db import models
  from django.db.models import DurationField as ModelDurationField
  from django.db.models.fields import Field as DjangoModelField
  from django.db.models.fields import FieldDoesNotExist
from django.utils import timezone
  from django.utils.functional import cached_property
  from django.utils.translation import ugettext_lazy as _
  
  from rest_framework.compat import Mapping, postgres_fields, unicode_to_repr
  from rest_framework.exceptions import ErrorDetail, ValidationError
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/serializers.py