(case_id, extension_index_tree, closed_cases)
return all_cases
traverse open incoming extensions
traverse open incoming extensions
traverse open incoming extensions
def traverse_incoming_extensions(case_id, extension_index_tree, closed_cases):
        """traverse open incoming extensions"""
        all_cases = set([case_id])
        new_cases = set([case_id])
        while new_cases:
            case_to_check = new_cases.pop()
            open_incoming_extension_indices = {
                case for case in
                extension_index_tree.get_cases_that_directly_depend_on_case(case_to_check)
                if case not in closed_cases
            }
            for incoming_case in open_incoming_extension_indices:
                new_cases.add(incoming_case)
                all_cases.add(incoming_case)
        return all_cases
def traverse_incoming_extensions ( case_id , extension_index_tree , closed_cases ) : all_cases = set ( [ case_id ] ) new_cases = set ( [ case_id ] ) while new_cases : case_to_check = new_cases . pop ( ) open_incoming_extension_indices = { case for case in extension_index_tree . get_cases_that_directly_depend_on_case ( case_to_check ) if case not in closed_cases } for incoming_case in open_incoming_extension_indices : new_cases . add ( incoming_case ) all_cases . add ( incoming_case ) return all_cases