'Recursively lists given urns. Results are cached.'

def RecursiveMultiListChildren(self, urns):

    result = {}
    checked_urns = set()
    not_cached_urns = []
    urns_to_check = urns
    while True:
        found_children = []
        for urn in urns_to_check:
            try:
                children = result[urn] = self._children_lists_cache[urn]
                found_children.extend(children)
            except KeyError:
                not_cached_urns.append(urn)
        checked_urns.update(urns_to_check)
        urns_to_check = (set(found_children) - checked_urns)
        if (not urns_to_check):
            break
    for (urn, children) in FACTORY.RecursiveMultiListChildren(not_cached_urns, token=self._token):
        result[urn] = self._children_lists_cache[urn] = children
    return result
