@classonlymethod
    def as_api_view(cls, **initkwargs):
        """
        Main entry point for an api request-response process.
        """
        # sanitize keyword arguments
        for key in initkwargs:
            if cls.http_method_names in key:
                raise TypeError(u"You tried to pass in the %s method name as a "
                                u"keyword argument to %s(). Don't do that."
                                % (key, cls.__name__))
            if not hasattr(cls, key):
                raise TypeError(u"%s() received an invalid keyword %r" % (
                    cls.__name__, key))

        def view(request, *args, **kwargs):
            self = cls(**initkwargs)
            return self.api_dispatch(request, *args, **kwargs)

        # take name and docstring from class
        functools.update_wrapper(view, cls, updated=())

        # and possible attributes set by decorators
        # like csrf_exempt from dispatch
        functools.update_wrapper(view, cls.dispatch, assigned=())
        return view
dataset/ETHPy150Open evanbrumley/django-report-tools/report_tools/views.py/ReportView.as_api_view/swapped operands of `in`