code: def test_torch_utils_dependencies(opt_dep):
      """Tests that the pytorch utils module correctly protects against uninstalled optional dependencies."""
      dependency_map = defaultdict(lambda: ["default"])
      for dependency, relations in [
          ("batch_compute_kernel_matrix", ["torch", "keops"]),
          ("mmd2", ["torch", "keops"]),
          ("mmd2_from_kernel_matrix", ["torch", "keops"]),
          ("squared_pairwise_distance", ["torch", "keops"]),
          ("GaussianRBF", ["torch", "keops"]),
          ("DeepKernel", ["torch", "keops"]),
          ("permed_lsdds", ["torch", "keops"]),
          ("predict_batch", ["torch", "keops"]),
          ("predict_batch_transformer", ["torch", "keops"]),
          ("quantile", ["torch", "keops"]),
          ("zero_diag", ["torch", "keops"]),
          ("TorchDataset", ["torch", "keops"]),
          ("get_device", ["torch", "keops"]),
          ("_save_state_dict", ["torch", "keops"]),
          ("_load_state_dict", ["torch", "keops"]),
      ]:
          dependency_map[dependency] = relations
      from alibi_detect.utils import pytorch as pytorch_utils
  
      check_correct_dependencies(pytorch_utils, 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 16 for calling a global function with example usage: test_torch_utils_dependencies(opt_dep) without return types