code: def profile(cls, profile_type: str) -> Iterator[None]:
      assert profile_type not in cls.profiling, (
          f"{profile_type} is already being profiled. "
          "SimpleProfiler does not support profiling multiple instances at "
          "the same time. "
      )
  
      cls.profiling.add(profile_type)
      begin = time.monotonic()
      try:
          yield
      finally:
          end = time.monotonic()
          cls.results[profile_type] += end - begin
          cls.profiling.remove(profile_type)
  
file_path: pytorch/torch/distributed/fsdp/_debug_utils.py
imports: import logging
  import time
  from collections import defaultdict
  from contextlib import contextmanager
  from enum import Enum
  from typing import Dict, Iterator, List, Set, Tuple
  import torch
  import torch.distributed.fsdp._flat_param
  from torch.distributed.fsdp._common_utils import _apply_to_modules, _get_module_fsdp_state, clean_tensor_name
label_desc: Use image node_id 2 for calling the SimpleProfiler obj's underlying member method code with example usage: obj.profile(cls, profile_type) without return types