@classmethod<EOL><INDENT>def traverse(cls, request, params=None):<DEDENT>
<EOL>result = cls.parse(request.path)<EOL>if result is None:<EOL><INDENT>return cls, {}<EOL><DEDENT>elif not result:<EOL><INDENT>raise http.exceptions.NotFound()<EOL><DEDENT>resource, data, rest = result<EOL>if params:<EOL><INDENT>data.update(params)<EOL><DEDENT>if resource is None:<EOL><INDENT>return cls, data<EOL><DEDENT>if data.get('<STR_LIT:path>') is not None:<EOL><INDENT>request.path = data.pop('<STR_LIT:path>')<EOL><DEDENT>elif rest is not None:<EOL><INDENT>request.path = rest<EOL><DEDENT>result = resource.traverse(request, params=data)<EOL>return result<EOL>
Traverses down the path and determines the accessed resource.

        This makes use of the patterns array to implement simple traversal.
        This defaults to a no-op if there are no defined patterns.