  except ImportError:
      # Python 2.7
      from collections import Mapping   # noqa
  
  try:
      # Python 3
      import urllib.parse as urlparse   # noqa
  except ImportError:
      # Python 2.7
      from urlparse import urlparse   # noqa
  
  try:
      from django.urls import (  # noqa
          URLPattern,
          URLResolver,
      )
 
</s> remove     pygments_css, urlparse, yaml
 </s> add     pygments_css, yaml
  except ImportError:
      # Python 2.7
      from collections import Mapping   # noqa
  







  try:
      from django.urls import (  # noqa
          URLPattern,
          URLResolver,
      )
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 compat: (py2) urlparse = urllib.parse (py3) (#6262)

* compat: (py2) urlparse = urllib.parse (py3)

We were mistakenly importing the 'urlparse' function from the Python 2
'urlparse' module, as opposed to the module itself. Correct this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #6261

* compat: Remove 'compat.urlparse'

We can just use Django's vendored six library, like we do everywhere
else.

Signed-off-by: Stephen Finucane <stephen@that.guru> 
rest_framework/compat.py