def process_request(self):
        """Executes the Sijax request and returns the response.

        Make sure that the current request is a Sijax request,
        using :attr:`sijax.Sijax.is_sijax_request` before calling this.
        A :class:`sijax.exception.SijaxError` will be raised,
        if this method is called for non-Sijax requests.

        If the function that was called from the browser is not
        registered (the function is unknown to Sijax),
        the :attr:`sijax.Sijax.EVENT_INVALID_REQUEST` event handler will
        be called instead.

        Refer to :meth:`sijax.Sijax.execute_callback` to see how the main
        handler is called and what the response (return value) is.
        """
        if not self.is_sijax_request:
            raise SijaxError('You should not call this for non-Sijax requests!')

        function_name = self.requested_function
        if function_name in self._callbacks:
            options = self._callbacks[function_name]
            args = self.request_args
        else:
            # Function not registered.. Let's call the invalid request handler
            # passing to it the function name that should've been called
            args = [function_name]
            callback = self._events[self.__class__.EVENT_INVALID_REQUEST]
            options = {self.__class__.PARAM_CALLBACK: callback}

        return self.execute_callback(args, **options)
dataset/ETHPy150Open spantaleev/sijax-python/sijax/core.py/Sijax.process_request/original