def __call__(self, environ, start_response):

        match =  self._mapper.match(environ['PATH_INFO'])
        if not match:
            return self._not_found(environ, start_response)

        controller_name = match['controller']
        action_name = match['action']        
        controller_action = (controller_name, action_name)

        del match['controller']
        del match['action']

        environ['concurrence.application'] = self

        #the actual request and response instances
        request = Request(environ)
        response = Response(content_type = self.default_content_type, charset = self.default_charset)

        #they will be added to the task local scope here:
        with self._scoped_request.set(request):
            with self._scoped_response.set(response):
                if not controller_action in self._filter_chain:
                    #we still need to setup call chain for this controller:action
                    #calling the controller is the last thing todo in the chain:
                    def last(next, *args, **kwargs):
                        return self.call_controller(controller_name, action_name, *args, **kwargs)
                    #set up call chain
                    filter_chain = []
                    for i, filter in enumerate(self._filters.get(controller_action, []) + [last, None]):
                        def create_next(_i, _filter):                        
                            def next(*args, **kwargs):
                                return _filter(filter_chain[_i + 1], *args, **kwargs)
                            return next
                        filter_chain.append(create_next(i, filter))
                    self._filter_chain[controller_action] = filter_chain
                #this will call the filter chain and produce the result
                result = self._filter_chain[controller_action][0](**match)
        
        if type(result) == str:
            response.body = result
        elif type(result) == unicode:
            response.unicode_body = result
        elif result is None:
            response.body = ''
        elif type(result) == type(response):
            response = result
        else:
            assert False, type(result) % "result must be None, str, unicode or response object, found: %s"

        return response(environ, start_response)
dataset/ETHPy150Open concurrence/concurrence/lib/concurrence/web/application.py/Application.__call__/swapped operands of `%`