def __call__(self, request, *args, **kwargs):
        """
        In case of the wrapped view being determined as a class (that it has
        a dispatch attribute) we return a new instance of the class with all
        view arguments passed to the dispatch method. The case of a view
        function things are much simpler, we just call the view function with
        the view arguments.

        For debugging purposes we insert some additional information that is
        useful for view classes in the raised exception.
        """
        try:
            if isclass(self.view):
                view = self.view()
                if hasattr(view, 'dispatch'):
                    return view.dispatch(request, *args, **kwargs)
            else:
                view = self.view
            if callable(view):
                return view(request, *args, **kwargs)
        except (Http404, PermissionDenied, __HOLE__):
            raise
        except Exception as ex:
            try:
                cls, e, trace = sys.exc_info()
                msg = '%s in %s.%s: %s' % (
                    cls.__name__, self.view.__module__, self.view.__name__, e
                    )
            except Exception:
                raise ex
            else:
                raise UtkikException(msg).with_traceback(trace)
        raise ImproperlyConfigured('%s.%s does not define a view function or '
            'class view.' % (self.view.__module__, self.view.__name__))
dataset/ETHPy150Open aino/aino-utkik/utkik/dispatch.py/ViewWrapper.__call__