code: def enable_checkpointing() -> Generator[None, None, None]:
      """Makes :func:`is_checkpointing` return :data:`True` within a context."""
      orig = thread_local.is_checkpointing
      thread_local.is_checkpointing = True
      try:
          yield
      finally:
          thread_local.is_checkpointing = orig
  
imports: from contextlib import contextmanager
  from dataclasses import dataclass
  import functools
  import threading
  from typing import Any, Dict, Generator, Optional, Tuple
  import weakref
  import torch
  from torch import Tensor
  import torch.nn
  import torch.utils.checkpoint
  from fairscale.internal.containers import pack_kwargs, split_non_tensors, unpack_kwargs, unpack_non_tensors
  from .checkpoint_utils import patch_batchnorm
label_desc: Use image node_id 2 for calling a global function with example usage: enable_checkpointing() without return types