code: def test_compare_frames(self) -> None:
      i = 0
      for example in TEST_EXAMPLES:
          self.assertEqual(
              compare_frames(
                  example["predicted"],
                  example["expected"],
                  tree_based=False,
              ),
              IntentSlotConfusions(
                  intent_confusions=Confusions(
                      **example["bracket_confusions"][
                          "intent_confusion"
                      ]
                  ),
                  slot_confusions=Confusions(
                      **example["bracket_confusions"]["slot_confusion"]
                  ),
              ),
              i,
          )
          self.assertEqual(
              compare_frames(
                  example["predicted"],
                  example["expected"],
                  tree_based=True,
              ),
              IntentSlotConfusions(
                  intent_confusions=Confusions(
                      **example["tree_confusions"]["intent_confusion"]
                  ),
                  slot_confusions=Confusions(
                      **example["tree_confusions"]["slot_confusion"]
                  ),
              ),
          )
          i += 1
  
file_path: pytext/pytext/metrics/tests/intent_slot_metrics_test.py
imports: from typing import Any, Dict, List
  from pytext.data.data_structures.annotation import INVALID_TREE_INTENT
  from pytext.metrics import Confusions, MacroPRF1Scores
  from pytext.metrics.intent_slot_metrics import compare_frames, compute_all_metrics, compute_frame_accuracies_by_depth, compute_frame_accuracy, compute_intent_slot_metrics, compute_percent_invalid_trees, compute_percent_trees_wrong_label, compute_top_intent_accuracy, FrameAccuracy, FramePredictionPair, IntentSlotConfusions, IntentSlotMetrics, Node, PRF1Metrics, PRF1Scores, Span
  from pytext.metrics.tests.metrics_test_base import MetricsTestBase
label_desc: Use image node_id 2 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_compare_frames() without return types