code: def unwrap_checkpoint(m: torch.nn.Module):
      """
      unwrap a module and its children from checkpoint_wrapper
      """
      for module in m.modules():
          if hasattr(module, "precheckpoint_forward"):
              module.forward = module.precheckpoint_forward
              del module.precheckpoint_forward
          if hasattr(module, "old_deepcopy_method"):
              module.__deepcopy__ = module.old_deepcopy_method
              del module.old_deepcopy_method
      return m
  
file_path: fairseq/fairseq/modules/checkpoint_activations.py
imports: import functools
  from typing import Any, Dict, List, Tuple, Union
  import torch
  import torch.utils.checkpoint
  from fairseq import utils
label_desc: Use image node_id 2 for calling a global function with example usage: unwrap_checkpoint(m) and returns: m