  from django.utils.encoding import iri_to_uri
  from django.utils.html import escape
  from django.utils.safestring import SafeData, mark_safe
  from django.utils.html import smart_urlquote
  from rest_framework.compat import urlparse, force_text
  from rest_framework.renderers import HTMLFormRenderer
  import re
  
  register = template.Library()
  
 
</s> remove from django.utils.encoding import iri_to_uri
 </s> add from django.utils.encoding import iri_to_uri, force_text </s> remove from rest_framework.compat import force_text
 </s> add  </s> remove from rest_framework.compat import yaml, etree, StringIO, BytesIO
 </s> add from rest_framework.compat import yaml, etree
from rest_framework.compat import urlparse
  from django.utils.encoding import iri_to_uri
  from django.utils.html import escape
  from django.utils.safestring import SafeData, mark_safe
  from django.utils.html import smart_urlquote
from rest_framework.compat import urlparse
  from rest_framework.renderers import HTMLFormRenderer
  import re
  
  register = template.Library()
  
keep keep keep keep replace keep keep keep keep keep
 Removed custom StringIO, force_text, smart_text compat 
rest_framework/templatetags/rest_framework.py