def getChildForRequest(resource, request):
    while request.postpath and not resource.isLeaf:
        pathElement = request.postpath.pop(0)
        request.prepath.append(pathElement)
        resource = resource.getChildWithDefault(pathElement, request)
    return resource
Traverse resource tree to find who will handle the request.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/web/resource.py/getChildForRequest