  def _is_extra_action(attr):
      return hasattr(attr, 'mapping')
  
  
  class ViewSetMixin(object):
      """
      This is the magic.
  
      Overrides `.as_view()` so that it takes an `actions` keyword that performs
      the binding of HTTP methods to actions on the Resource.
 
</s> remove         class AuthRaisesAttributeError(object):
 </s> add         class AuthRaisesAttributeError: </s> remove class UniqueValidator(object):
 </s> add class UniqueValidator: </s> remove         if data == '' or (self.trim_whitespace and six.text_type(data).strip() == ''):
 </s> add         if data == '' or (self.trim_whitespace and str(data).strip() == ''): </s> remove         instance = super(Field, cls).__new__(cls)
 </s> add         instance = super().__new__(cls) </s> remove         return unicode_to_repr(representation.field_repr(self))
 </s> add         return representation.field_repr(self)
class ViewSetMixin:
  def _is_extra_action(attr):
      return hasattr(attr, 'mapping')
  
  
class ViewSetMixin:
      """
      This is the magic.
  
      Overrides `.as_view()` so that it takes an `actions` keyword that performs
      the binding of HTTP methods to actions on the Resource.
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/viewsets.py