def METHOD_NAME(self, request):
    if not self.nodes_dict:
        self.nodes_dict = self.build_nodes_dict()
    branches = []
    try:
        namespace = request.resolver_match.namespace
    except AttributeError:
        namespace = "misago:admin"
    if namespace in self.nodes_dict:
        node = self.nodes_dict[namespace]
        while node:
            children = node.children_as_dicts()
            if children:
                branches.append(children)
            node = node.parent
    try:
        namespaces = request.resolver_match.namespaces
    except AttributeError:
        namespaces = ["misago", "admin"]
    branches.reverse()
    for depth, branch in enumerate(branches):
        depth_namespace = namespaces[2 : 3 + depth]
        for node in branch:
            node_namespace = node["namespace"].split(":")[2 : 3 + depth]
            if request.resolver_match:
                node["is_active"] = depth_namespace == node_namespace
            else:
                node["is_active"] = False
    return branches