code: def test_saving_torch_dependencies(opt_dep):
      """Tests that the alibi_detect.saving._pytorch module correctly protects against uninstalled optional
      dependencies.
      """
      dependency_map = defaultdict(lambda: ["default"])
      for dependency, relations in [
          ("load_embedding_pt", ["torch", "keops"]),
          ("load_kernel_config_pt", ["torch", "keops"]),
          ("load_model_pt", ["torch", "keops"]),
          ("load_optimizer_pt", ["torch", "keops"]),
          ("prep_model_and_emb_pt", ["torch", "keops"]),
          ("save_model_config_pt", ["torch", "keops"]),
          ("get_pt_dtype", ["torch", "keops"]),
          ("save_device_pt", ["torch", "keops"]),
      ]:
          dependency_map[dependency] = relations
      from alibi_detect.saving import _pytorch as pt_saving
  
      check_correct_dependencies(pt_saving, dependency_map, opt_dep)
  
file_path: alibi-detect/alibi_detect/tests/test_dep_management.py
imports: from types import ModuleType
  from collections import defaultdict
label_desc: Use image node_id 13 for calling a global function with example usage: test_saving_torch_dependencies(opt_dep) without return types