code: def _assert_allclose(
      pl_result: Dict[str, Tensor],
      sk_result: Dict[str, Tensor],
      atol: float = 1e-8,
      key: Optional[str] = None,
  ) -> None:
      if isinstance(pl_result, dict) and key is None:
          for (pl_key, pl_val), (sk_key, sk_val) in zip(
              pl_result.items(), sk_result.items()
          ):
              assert np.allclose(
                  pl_val.detach().cpu().numpy(),
                  sk_val.numpy(),
                  atol=atol,
                  equal_nan=True,
              ), f"{pl_key} != {sk_key}"
      else:
          _core_assert_allclose(pl_result, sk_result, atol, key)
  
imports: import inspect
  from functools import partial
  from typing import Any, Callable, Dict, Optional
  from unittest import mock
  import numpy
  import pandas
  import pytest
  import torch
  from fairlearn.metrics import MetricFrame, selection_rate, true_positive_rate
  from scipy.special import expit
  from torch import Tensor
  from torchmetrics import Metric
  from torchmetrics.classification.group_fairness import BinaryFairness
  from torchmetrics.functional.classification.group_fairness import binary_fairness
  from torchmetrics.utilities.imports import _PYTHON_LOWER_3_8
  from unittests import THRESHOLD
  from unittests.classification.inputs import _group_cases
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester, _assert_dtype_support, inject_ignore_index, remove_ignore_index_groups
  from unittests.helpers.testers import _assert_allclose
  from unittests.helpers.testers import _assert_requires_grad
  from unittests.helpers.testers import _assert_tensor
label_desc: Use image node_id 3 for calling a global function with example usage: _assert_allclose(pl_result, sk_result, atol, key) without return types