  
  from django.core.exceptions import PermissionDenied
  from django.http import Http404
  from rest_framework import exceptions, serializers
  from rest_framework.compat import force_text, OrderedDict
  from rest_framework.request import clone_request
  from rest_framework.utils.field_mapping import ClassLookupDict
  
  
  class BaseMetadata(object):
 
</s> remove from rest_framework.compat import smart_text, HttpResponseBase, View
 </s> add from rest_framework.compat import HttpResponseBase, View </s> remove from rest_framework.compat import force_text, OrderedDict
 </s> add from rest_framework.compat import OrderedDict </s> remove from rest_framework.compat import etree, yaml, force_text, urlparse
 </s> add from django.utils.encoding import force_text
from rest_framework.compat import etree, yaml, urlparse
from rest_framework.compat import OrderedDict
  
  from django.core.exceptions import PermissionDenied
  from django.http import Http404
  from rest_framework import exceptions, serializers
from rest_framework.compat import OrderedDict
  from rest_framework.request import clone_request
  from rest_framework.utils.field_mapping import ClassLookupDict
  
  
  class BaseMetadata(object):
keep keep keep keep replace keep keep keep keep keep
 Removed custom StringIO, force_text, smart_text compat 
rest_framework/metadata.py