code: def test_module_class_replaces_dropout_layers(
      a_model_with_dropout, is_deterministic
  ):
      dummy_shape = (10, 10)
      test_module = a_model_with_dropout
      test_mc_module = (
          baal.bayesian.consistent_dropout.MCConsistentDropoutModule(
              test_module
          )
      )
  
      assert not any(
          isinstance(module, torch.nn.Dropout)
          for module in test_module.modules()
      )
      assert any(
          isinstance(
              module, baal.bayesian.consistent_dropout.ConsistentDropout
          )
          for module in test_module.modules()
      )
  
      # Check that unpatch works
      module = test_mc_module.unpatch()
      module.eval()
      assert is_deterministic(module, dummy_shape)
      assert not any(
          isinstance(
              mod, baal.bayesian.consistent_dropout.ConsistentDropout
          )
          for mod in module.modules()
      )
  
file_path: baal/tests/bayesian/consistent_dropout_test.py
imports: import warnings
  from copy import deepcopy
  import pytest
  import torch
  import baal.bayesian.consistent_dropout
label_desc: Use image node_id 5 for calling a global function with example usage: test_module_class_replaces_dropout_layers(a_model_with_dropout, is_deterministic) without return types