def get_args(self, state, all_params, remainder, argspec, im_self):
        # When comparing the argspec of the method to GET/POST params,
        # ignore the implicit (req, resp) at the beginning of the function
        # signature
        if hasattr(state.controller, '__self__'):
            _repr = '.'.join((
                state.controller.__self__.__class__.__module__,
                state.controller.__self__.__class__.__name__,
                state.controller.__name__
            ))
        else:
            _repr = '.'.join((
                state.controller.__module__,
                state.controller.__name__
            ))

        signature_error = TypeError(
            'When `use_context_locals` is `False`, pecan passes an explicit '
            'reference to the request and response as the first two arguments '
            'to the controller.\nChange the `%s` signature to accept exactly '
            '2 initial arguments (req, resp)' % _repr
        )
        try:
            positional = argspec.args[:]
            positional.pop(1)  # req
            positional.pop(1)  # resp
            argspec = argspec._replace(args=positional)
        except __HOLE__:
            raise signature_error

        args, varargs, kwargs = super(ExplicitPecan, self).get_args(
            state, all_params, remainder, argspec, im_self
        )

        if ismethod(state.controller):
            args = [state.request, state.response] + args
        else:
            # generic controllers have an explicit self *first*
            # (because they're decorated functions, not instance methods)
            args[1:1] = [state.request, state.response]
        return args, varargs, kwargs
dataset/ETHPy150Open pecan/pecan/pecan/core.py/ExplicitPecan.get_args