code: def _time(trace_name, name, time=True):
      if (not _JIT_TIME and not time) or not torch.cuda.is_available():
          yield
          return
      stream = torch.cuda.current_stream()
      start = torch.cuda.Event(enable_timing=True)
      end = torch.cuda.Event(enable_timing=True)
      stream.record_event(start)
      try:
          yield
      finally:
          stream.record_event(end)
          end.synchronize()
          print(
              f"{trace_name} {name} time: {start.elapsed_time(end)} ms"
          )
  
imports: import contextlib
  import copy
  import functools
  import inspect
  import os
  import re
  import warnings
  from typing import Any, Callable, Dict, List, Optional, Set, TypeVar
  from typing_extensions import ParamSpec
  import torch
  from torch._jit_internal import _qualified_name, get_callable_argument_names, is_scripting
  from torch.autograd import function
  from torch.jit._script import _CachedForward, script, ScriptModule
  from torch.jit._state import _enabled, _python_cu
  from torch.nn import Module
  from torch.testing._comparison import default_tolerances
label_desc: Use image node_id 4 for calling a global function with example usage: _time(trace_name, name, time) without return types