class_docstr: Signal that a global may be replaced with a deserialized copy.
  
  See `GlobalsBridge` for why this matters.
class_docstr_tok: ["Signal","that","a","global","may","be","replaced","with","a","deserialized","copy",".","See","`","GlobalsBridge","`","for","why","this","matters","."]
code: def __init__(self, value: Any, *, setup: Optional[str] = None):
      for method, supported_types in _GLOBALS_ALLOWED_TYPES.items():
          if any(isinstance(value, t) for t in supported_types):
              self._value: Any = value
              self._setup: Optional[str] = setup
              self._serialization: Serialization = method
              break
      else:
          supported_str = "\n".join(
              [
                  getattr(t, "__name__", repr(t))
                  for t in it.chain(_GLOBALS_ALLOWED_TYPES.values())
              ]
          )
  
          raise ValueError(
              f"Unsupported type: {type(value)}\n"
              f"`collect_callgrind` restricts globals to the following types:\n"
              f"{textwrap.indent(supported_str, '  ')}"
          )
  
imports: import collections
  import enum
  import dataclasses
  import itertools
  import os
  import pickle
  import re
  import shutil
  import subprocess
  import sys
  import textwrap
  from typing import cast, Any, Callable, DefaultDict, Dict, Iterator, List, NamedTuple, Optional, Tuple, Union, TYPE_CHECKING
  import torch
  from torch.utils.benchmark.utils import common, cpp_jit
  from torch.utils.benchmark.utils._stubs import CallgrindModuleType
  import operator
label_desc: Use image node_id 1 to create a new CopyIfCallgrind object  with example: obj = CopyIfCallgrind(value)