code: def enable_dropout(model):
      modules = dict(
          {name: module for name, module in model.named_modules()}
      )
      altered_modules = []
  
      for name, mod in modules.items():
          if isinstance(mod, DROPOUT_MODULES) and mod.training is False:
              mod.train()
              altered_modules.append(name)
      yield
      for name in altered_modules:
          modules[name].eval()
  
imports: import torch
  import torch.nn
  from contextlib import contextmanager
  from small_text.utils.annotations import deprecated
label_desc: Use image node_id 2 for calling a global function with example usage: enable_dropout(model) without return types