          return value.decode('iso-8859-1')
      return value
  
  
  def total_seconds(timedelta):
      # TimeDelta.total_seconds() is only available in Python 2.7
      if hasattr(timedelta, 'total_seconds'):
          return timedelta.total_seconds()
      else:
          return (timedelta.days * 86400.0) + float(timedelta.seconds) + (timedelta.microseconds / 1000000.0)
  
  
  def distinct(queryset, base):
      if settings.DATABASES[queryset.db]["ENGINE"] == "django.db.backends.oracle":
          # distinct analogue for Oracle users
          return base.filter(pk__in=set(queryset.values_list('pk', flat=True)))
      return queryset.distinct()
 
</s> remove     def test_total_seconds(self):
        class MockTimedelta(object):
            days = 1
            seconds = 1
            microseconds = 100
        timedelta = MockTimedelta()
        expected = (timedelta.days * 86400.0) + float(timedelta.seconds) + (timedelta.microseconds / 1000000.0)
        assert compat.total_seconds(timedelta) == expected

 </s> add  </s> remove             return six.text_type(total_seconds(obj))
 </s> add             return six.text_type(obj.total_seconds()) </s> remove from rest_framework.compat import coreapi, total_seconds
 </s> add from rest_framework.compat import coreapi
          return value.decode('iso-8859-1')
      return value
  
  








  def distinct(queryset, base):
      if settings.DATABASES[queryset.db]["ENGINE"] == "django.db.backends.oracle":
          # distinct analogue for Oracle users
          return base.filter(pk__in=set(queryset.values_list('pk', flat=True)))
      return queryset.distinct()
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 Drop compat wrapper for TimeDelta.total_seconds() (#5577)

TimeDelta.total_seconds() was introduced in Python 2.7 and 3.2. It is
available on all supported Python versions.

https://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds
https://docs.python.org/3/library/datetime.html#datetime.timedelta.total_seconds 
rest_framework/compat.py