code: def create_event_recorder(
      event_name: str, dummy: bool = False
  ) -> EventRecorder:
      if not dummy:
          return CudaEventRecorder(event_name)
      return DummyCudaEventRecorder()
  
imports: from collections import defaultdict, deque
  from functools import partial
  import statistics
  from typing import ClassVar, Deque, Dict, Optional
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: create_event_recorder(event_name, dummy) and returns: DummyCudaEventRecorder, CudaEventRecorder