def _traverse(roots, parent):
    for root in roots:
        path = ((parent + '/') + root.raw_segment)
        if (root.resource is not None):
            methods = []
            if root.method_map:
                for (method, func) in root.method_map.items():
                    if isinstance(func, partial):
                        real_func = func.func
                    else:
                        real_func = func
                    source_info = _get_source_info(real_func)
                    internal = _is_internal(real_func)
                    method_info = RouteMethodInfo(method, source_info, real_func.__name__, internal)
                    methods.append(method_info)
            (source_info, class_name) = _get_source_info_and_name(root.resource)
            route_info = RouteInfo(path, class_name, source_info, methods)
            routes.append(route_info)
        if root.children:
            _traverse(root.children, path)
def _traverse(roots, parent):
    for root in roots:
        path = ((parent + '/') + root.raw_segment)
        if (root.resource is not None):
            methods = []
            if root.method_map:
                for (method, func) in root.method_map.items():
                    if isinstance(func, partial):
                        real_func = func.func
                    else:
                        real_func = func
                    source_info = _get_source_info(real_func)
                    internal = _is_internal(real_func)
                    method_info = RouteMethodInfo(method, source_info, real_func.__name__, internal)
                    methods.append(method_info)
            (source_info, class_name) = _get_source_info_and_name(root.resource)
            route_info = RouteInfo(path, class_name, source_info, methods)
            routes.append(route_info)
        if root.children:
            _traverse(root.children, path)