def is_api_view(callback):
    """
    Return `True` if the given view callback is a REST framework view/viewset.
    """
    from rest_framework.views import APIView
    cls = getattr(callback, 'cls', None)
    return cls is not None and issubclass(cls, APIView)
