def compute_compilation_order(verbose: bool, dependency_graph: Dict[(CompilationUnit, List[Path])]) -> List[CompilationUnit]:
    compilation_order: List[CompilationUnit] = []
    while (len(compilation_order) < len(dependency_graph)):
        candidate_unit = next((u for u in dependency_graph.keys() if (u not in compilation_order)))
        breadcrumbs = [candidate_unit]
        while True:
            uncompiled_dependencies = [u for u in dependency_graph.keys() if ((u not in compilation_order) and (u.source_path in dependency_graph[candidate_unit]))]
            if (not uncompiled_dependencies):
                break
            candidate_unit = uncompiled_dependencies[0]
            if (candidate_unit in breadcrumbs):
                message = ((' --> '.join((d.source_path.name for d in breadcrumbs)) + ' --> ') + candidate_unit.source_path.name)
                raise RuntimeError(('cyclic imports: ' + message))
            breadcrumbs.append(candidate_unit)
        compilation_order.append(candidate_unit)
    return compilation_order
def compute_compilation_order(verbose: bool, dependency_graph: Dict[(CompilationUnit, List[Path])]) -> List[CompilationUnit]:
    compilation_order: List[CompilationUnit] = []
    while (len(compilation_order) < len(dependency_graph)):
        candidate_unit = next((u for u in dependency_graph.keys() if (u not in compilation_order)))
        breadcrumbs = [candidate_unit]
        while True:
            uncompiled_dependencies = [u for u in dependency_graph.keys() if ((u not in compilation_order) and (u.source_path in dependency_graph[candidate_unit]))]
            if (not uncompiled_dependencies):
                break
            candidate_unit = uncompiled_dependencies[0]
            if (candidate_unit in breadcrumbs):
                message = ((' --> '.join((d.source_path.name for d in breadcrumbs)) + ' --> ') + candidate_unit.source_path.name)
                raise RuntimeError(('cyclic imports: ' + message))
            breadcrumbs.append(candidate_unit)
        compilation_order.append(candidate_unit)
    return compilation_order