code: def test_pytorch_model_dependencies(opt_dep):
      """Tests that the pytorch model module correctly protects against uninstalled optional dependencies."""
      torch_model_dependency_map = defaultdict(lambda: ["default"])
      for dependency, relations in [
          ("ADULTEncoder", ["torch"]),
          ("ADULTDecoder", ["torch"]),
          ("MNISTEncoder", ["torch"]),
          ("MNISTDecoder", ["torch"]),
          ("MNISTClassifier", ["torch"]),
          ("HeAE", ["torch"]),
          ("AE", ["torch"]),
          ("Actor", ["torch"]),
          ("Critic", ["torch"]),
      ]:
          torch_model_dependency_map[dependency] = relations
      from alibi.models import pytorch
  
      check_correct_dependencies(
          pytorch, torch_model_dependency_map, opt_dep
      )
  
file_path: alibi/alibi/tests/test_dep_management.py
imports: from types import ModuleType
  from collections import defaultdict
label_desc: Use image node_id 7 for calling a global function with example usage: test_pytorch_model_dependencies(opt_dep) without return types