  from django.core import validators
  from django.utils import six
  from django.views.generic import View
  
  try:
      from django.urls import (  # noqa
          URLPattern,
          URLResolver,
      )
 
</s> remove from rest_framework.compat import postgres_fields, unicode_to_repr
 </s> add from rest_framework.compat import Mapping, postgres_fields, unicode_to_repr </s> remove from collections import Mapping, OrderedDict
 </s> add from collections import OrderedDict
try:
    # Python 3 (required for 3.8+)
    from collections.abc import Mapping   # noqa
except ImportError:
    # Python 2.7
    from collections import Mapping   # noqa

  from django.core import validators
  from django.utils import six
  from django.views.generic import View
  
try:
    # Python 3 (required for 3.8+)
    from collections.abc import Mapping   # noqa
except ImportError:
    # Python 2.7
    from collections import Mapping   # noqa

  try:
      from django.urls import (  # noqa
          URLPattern,
          URLResolver,
      )
keep keep keep add keep keep keep keep keep
 Fix Python 3.8 compatibility (#6154) 
rest_framework/compat.py