Path 1: 3 calls (1.0)

dict_items (3)

{} (3)

1def _make_tree_defs(mod_files_list: ItemsView[str, set[str]]) -> _ImportTree:
2    """Get a list of 2-uple (module, list_of_files_which_import_this_module),
3    it will return a dictionary to represent this as a tree.
4    """
5    tree_defs: _ImportTree = {}
6    for mod, files in mod_files_list:
7        node: list[_ImportTree | list[str]] = [tree_defs, []]
8        for prefix in mod.split("."):
9            assert isinstance(node[0], dict)
10            node = node[0].setdefault(prefix, ({}, []))  # type: ignore[arg-type,assignment]
11        assert isinstance(node[1], list)
12        node[1].extend(files)
13    return tree_defs