code: def almosteq(actual, expected, tol=0.01):
      assert type(actual) == type(
          expected
      ), f"Result type mismatch {type(actual)}, {type(expected)}"
      assert (
          (actual != actual and expected != expected)
          or actual == expected
          or abs(expected - actual) / abs(expected) < tol
      ), f"Result differs: actual={actual} expected={expected}"
  
file_path: tslumen/tests/unit/profile/base.py
imports: from datetime import datetime
  from dataclasses import is_dataclass
  import numpy
  import pandas
  from tslumen.profile.base import ProfileResult, ProfilingFunction
label_desc: Use image node_id 6 for calling a global function with example usage: almosteq(actual, expected, tol) without return types