code: def assert_parity_absolute(
      pl_values, pt_values, norm_by: float = 1, max_diff: float = 0.55
  ):
      # assert speeds
      diffs = np.asarray(pl_values) - np.mean(pt_values)
      # norm by event count
      diffs = diffs / norm_by
      assert (
          np.mean(diffs) < max_diff
      ), f"Lightning {diffs} was worse than vanilla PT (threshold {max_diff})"
  
file_path: pytorch-lightning/tests/parity_pytorch/test_basic_parity.py
imports: import os
  import numpy
  import pytest
  import torch
  from lightning.pytorch import LightningModule, Trainer, seed_everything
  from tests_pytorch.helpers.advanced_models import ParityModuleMNIST, ParityModuleRNN
  from parity_pytorch.measure import measure_loops
  from parity_pytorch.models import ParityModuleCIFAR
label_desc: Use image node_id 2 for calling a global function with example usage: assert_parity_absolute(pl_values, pt_values, norm_by, max_diff) without return types