code: def get_cycles_per_ms() -> float:
      """Get 10 values and remove the 2 max and 2 min and return the avg.
  
      This is to avoid system disturbance that skew the results, e.g. the very first cuda call likely does a bunch of
      init, which takes much longer than subsequent calls.
  
      """
  
      def measure() -> float:
          """Measure and return approximate number of cycles per millisecond for `torch.cuda._sleep` Copied from:
  
          https://github.com/pytorch/pytorch/blob/v1.9.0/test/test_cuda.py#L81.
  
          """
          start = torch.cuda.Event(enable_timing=True)
          end = torch.cuda.Event(enable_timing=True)
          start.record()
          torch.cuda._sleep(1000000)
          end.record()
          end.synchronize()
          # cycles_per_ms
          return 1000000 / start.elapsed_time(end)
  
      num = 10
      vals = []
      for _ in range(num):
          vals.append(measure())
      vals = sorted(vals)
      stats = vals[2 : num - 2]
      return sum(stats) / len(stats)
  
imports: from collections import Counter
  from typing import Any, Iterator
  import pytest
  import torch
  from lightning.pytorch import LightningDataModule, Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset
  from lightning.pytorch.loops.fetchers import _DataLoaderIterDataFetcher, _PrefetchDataFetcher
  from lightning.pytorch.profilers import SimpleProfiler
  from lightning.pytorch.utilities.combined_loader import CombinedLoader
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.types import STEP_OUTPUT
  from torch import Tensor
  from torch.utils.data import DataLoader, Dataset, IterableDataset
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 4 for calling a global function with example usage: get_cycles_per_ms() and returns: unknown, unknown