          Handles SortedDicts as usual dicts, but preserves field order, rather
          than the usual behaviour of sorting the keys.
          """
          def represent_decimal(self, data):
              return self.represent_scalar('tag:yaml.org,2002:str', str(data))
  
          def represent_mapping(self, tag, mapping, flow_style=None):
              value = []
              node = yaml.MappingNode(tag, value, flow_style=flow_style)
              if self.alias_key is not None:
 
</s> remove         return str(value).strip()
 </s> add         return six.text_type(value).strip() </s> remove             (str(key), key) for key in self.choices.keys()
 </s> add             (six.text_type(key), key) for key in self.choices.keys() </s> remove             value = decimal.Decimal(str(value).strip())
 </s> add             value = decimal.Decimal(six.text_type(value).strip()) </s> remove         return str(value)
 </s> add         return six.text_type(value) </s> remove         return self.choice_strings_to_values[str(value)]
 </s> add         return self.choice_strings_to_values[six.text_type(value)]
            return self.represent_scalar('tag:yaml.org,2002:str', six.text_type(data))
          Handles SortedDicts as usual dicts, but preserves field order, rather
          than the usual behaviour of sorting the keys.
          """
          def represent_decimal(self, data):
            return self.represent_scalar('tag:yaml.org,2002:str', six.text_type(data))
  
          def represent_mapping(self, tag, mapping, flow_style=None):
              value = []
              node = yaml.MappingNode(tag, value, flow_style=flow_style)
              if self.alias_key is not None:
keep keep keep keep replace keep keep keep keep keep
 Use six.text_type instead of str everywhere 
rest_framework/utils/encoders.py