  """
  from django.conf import settings
  from django.views.generic import View
  
  try:
      from django.urls import (  # noqa
          URLPattern,
          URLResolver,
      )
  except ImportError:
      # Will be removed in Django 2.0
      from django.urls import (  # noqa
          RegexURLPattern as URLPattern,
          RegexURLResolver as URLResolver,
      )
  
  
  def get_original_route(urlpattern):
      """
      Get the original route/regex that was typed in by the user into the path(), re_path() or url() directive. This
      is in contrast with get_regex_pattern below, which for RoutePattern returns the raw regex generated from the path().
      """
      if hasattr(urlpattern, 'pattern'):
          # Django 2.0
          return str(urlpattern.pattern)
      else:
          # Django < 2.0
          return urlpattern.regex.pattern
  
  
  def get_regex_pattern(urlpattern):
      """
      Get the raw regex out of the urlpattern's RegexPattern or RoutePattern. This is always a regular expression,
      unlike get_original_route above.
      """
      if hasattr(urlpattern, 'pattern'):
          # Django 2.0
          return urlpattern.pattern.regex.pattern
      else:
          # Django < 2.0
          return urlpattern.regex.pattern
  
  
  def is_route_pattern(urlpattern):
      if hasattr(urlpattern, 'pattern'):
          # Django 2.0
          from django.urls.resolvers import RoutePattern
          return isinstance(urlpattern.pattern, RoutePattern)
      else:
          # Django < 2.0
          return False
  
  
  def make_url_resolver(regex, urlpatterns):
      try:
          # Django 2.0
          from django.urls.resolvers import RegexPattern
          return URLResolver(RegexPattern(regex), urlpatterns)
  
      except ImportError:
          # Django < 2.0
          return URLResolver(regex, urlpatterns)
  
  
  def unicode_http_header(value):
      # Coerce HTTP header value to unicode.
      if isinstance(value, bytes):
          return value.decode('iso-8859-1')
 
</s> remove             if is_route_pattern(urlpattern):
 </s> add             if isinstance(urlpattern.pattern, RoutePattern): </s> remove             if is_route_pattern(urlpattern):
 </s> add             if isinstance(urlpattern.pattern, RoutePattern): </s> remove             regex = get_regex_pattern(urlpattern).rstrip('$').rstrip('/') + suffix_pattern
 </s> add             regex = urlpattern.pattern.regex.pattern.rstrip('$').rstrip('/') + suffix_pattern </s> remove             regex = get_regex_pattern(urlpattern)
 </s> add             regex = urlpattern.pattern.regex.pattern </s> remove         resolver = make_url_resolver(r'^/', urlpatterns)
 </s> add         resolver = URLResolver(RegexPattern(r'^/'), urlpatterns)
  """
  from django.conf import settings
  from django.views.generic import View
  



























































  
  def unicode_http_header(value):
      # Coerce HTTP header value to unicode.
      if isinstance(value, bytes):
          return value.decode('iso-8859-1')
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Drop all compat support to Django < 2 urls (#7337) 
rest_framework/compat.py