  from django.utils.safestring import SafeData, mark_safe
  from django.utils.html import smart_urlquote
  from rest_framework.renderers import HTMLFormRenderer
  from rest_framework.utils.urls import replace_query_param
  import re
  
  register = template.Library()
  
  # Regex for adding classes to html snippets
  class_re = re.compile(r'(?<=class=["\'])(.*)(?=["\'])')
 
</s> remove from django.utils.safestring import SafeData, mark_safe
 </s> add  </s> remove from django.utils.encoding import iri_to_uri, force_text
 </s> add  </s> remove from django.core.urlresolvers import reverse, NoReverseMatch
 </s> add 
  from django.utils.safestring import SafeData, mark_safe
  from django.utils.html import smart_urlquote
  from rest_framework.renderers import HTMLFormRenderer
  from rest_framework.utils.urls import replace_query_param

  
  register = template.Library()
  
  # Regex for adding classes to html snippets
  class_re = re.compile(r'(?<=class=["\'])(.*)(?=["\'])')
keep keep keep keep replace keep keep keep keep keep
 Cleanup import following PEP 8 style guide 
rest_framework/templatetags/rest_framework.py