          elif '@' in value and not re.search(r'\s', value):
              return mark_safe('<a href="mailto:{value}">{value}</a>'.format(value=escape(value)))
          elif '\n' in value:
              return mark_safe('<pre>%s</pre>' % escape(value))
      return six.text_type(value)
  
  
  @register.filter
  def items(value):
      """
 
</s> remove     elif isinstance(value, six.string_types):
 </s> add     elif isinstance(value, str): </s> remove         name = six.text_type(value.obj)
 </s> add         name = str(value.obj) </s> remove     elif isinstance(val, six.string_types):
 </s> add     elif isinstance(val, str): </s> remove         return super(JSONEncoder, self).default(obj)
 </s> add         return super().default(obj) </s> remove             return six.text_type(obj)
 </s> add             return str(obj)
    return str(value)
          elif '@' in value and not re.search(r'\s', value):
              return mark_safe('<a href="mailto:{value}">{value}</a>'.format(value=escape(value)))
          elif '\n' in value:
              return mark_safe('<pre>%s</pre>' % escape(value))
    return str(value)
  
  
  @register.filter
  def items(value):
      """
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/templatetags/rest_framework.py