(case_id, child_index_tree, extension_index_tree)
return all_cases
Takes a child and extension index tree and returns returns a set of all dependencies of <case_id>

        Traverse each incoming index, return each touched case.
        Traverse each outgoing index in the extension tree, return each touched case
Takes a child and extension index tree and returns returns a set of all dependencies of <case_id>
Takes a child and extension index tree and returns returns a set of all dependencies of <case_id >
def get_all_dependencies(case_id, child_index_tree, extension_index_tree):
        """Takes a child and extension index tree and returns returns a set of all dependencies of <case_id>

        Traverse each incoming index, return each touched case.
        Traverse each outgoing index in the extension tree, return each touched case
        """
        all_cases = set()
        cases_to_check = set([case_id])
        while cases_to_check:
            case_to_check = cases_to_check.pop()
            all_cases.add(case_to_check)
            incoming_extension_indices = extension_index_tree.get_cases_that_directly_depend_on_case(
                case_to_check
            )
            incoming_child_indices = child_index_tree.get_cases_that_directly_depend_on_case(case_to_check)
            all_incoming_indices = incoming_extension_indices | incoming_child_indices
            new_outgoing_cases_to_check = set(extension_index_tree.indices.get(case_to_check, {}).values())
            new_cases_to_check = (new_outgoing_cases_to_check | all_incoming_indices) - all_cases

            cases_to_check |= new_cases_to_check

        return all_cases
def get_all_dependencies ( case_id , child_index_tree , extension_index_tree ) : all_cases = set ( ) cases_to_check = set ( [ case_id ] ) while cases_to_check : case_to_check = cases_to_check . pop ( ) all_cases . add ( case_to_check ) incoming_extension_indices = extension_index_tree . get_cases_that_directly_depend_on_case ( case_to_check ) incoming_child_indices = child_index_tree . get_cases_that_directly_depend_on_case ( case_to_check ) all_incoming_indices = incoming_extension_indices | incoming_child_indices new_outgoing_cases_to_check = set ( extension_index_tree . indices . get ( case_to_check , { } ) . values ( ) ) new_cases_to_check = ( new_outgoing_cases_to_check | all_incoming_indices ) - all_cases cases_to_check |= new_cases_to_check return all_cases