(case_id, child_index_tree, extension_index_tree)
return all_cases
traverse all outgoing child and extension indices
traverse all outgoing child and extension indices
traverse all outgoing child and extension indices
def get_all_outgoing_cases(case_id, child_index_tree, extension_index_tree):
        """traverse all outgoing child and extension indices"""
        all_cases = set([case_id])
        new_cases = set([case_id])
        while new_cases:
            case_to_check = new_cases.pop()
            parent_cases = set(child_index_tree.indices.get(case_to_check, {}).values())
            host_cases = set(extension_index_tree.indices.get(case_to_check, {}).values())
            new_cases = (new_cases | parent_cases | host_cases) - all_cases
            all_cases = all_cases | parent_cases | host_cases
        return all_cases
def get_all_outgoing_cases ( case_id , child_index_tree , extension_index_tree ) : all_cases = set ( [ case_id ] ) new_cases = set ( [ case_id ] ) while new_cases : case_to_check = new_cases . pop ( ) parent_cases = set ( child_index_tree . indices . get ( case_to_check , { } ) . values ( ) ) host_cases = set ( extension_index_tree . indices . get ( case_to_check , { } ) . values ( ) ) new_cases = ( new_cases | parent_cases | host_cases ) - all_cases all_cases = all_cases | parent_cases | host_cases return all_cases