  # no longer support Python 2.6.
  # For Django <= 1.6 and Python 2.6 fall back to OrderedDict.
  try:
      from collections import OrderedDict
  except:
      from django.utils.datastructures import SortedDict as OrderedDict
  
  
  # HttpResponseBase only exists from 1.5 onwards
  try:
 
</s> remove # Handle django.utils.encoding rename in 1.5 onwards.
# smart_unicode -> smart_text
# force_unicode -> force_text
try:
    from django.utils.encoding import smart_text
except ImportError:
    from django.utils.encoding import smart_unicode as smart_text
try:
    from django.utils.encoding import force_text
except ImportError:
    from django.utils.encoding import force_unicode as force_text


 </s> add  </s> remove def get_concrete_model(model_cls):
    try:
        return model_cls._meta.concrete_model
    except AttributeError:
        # 1.3 does not include concrete model
        return model_cls


 </s> add  </s> remove # cStringIO only if it's available, otherwise StringIO
try:
    import cStringIO.StringIO as StringIO
except ImportError:
    StringIO = six.StringIO

BytesIO = six.BytesIO


 </s> add  </s> remove from django.utils.encoding import python_2_unicode_compatible
from rest_framework.compat import apply_markdown, smart_text
 </s> add from django.utils.encoding import python_2_unicode_compatible, smart_text
from rest_framework.compat import apply_markdown </s> remove from rest_framework.compat import BytesIO
 </s> add 
except ImportError:
  # no longer support Python 2.6.
  # For Django <= 1.6 and Python 2.6 fall back to OrderedDict.
  try:
      from collections import OrderedDict
except ImportError:
      from django.utils.datastructures import SortedDict as OrderedDict
  
  
  # HttpResponseBase only exists from 1.5 onwards
  try:
keep keep keep keep replace keep keep keep keep keep
 Removed custom StringIO, force_text, smart_text compat 
rest_framework/compat.py