code: def test_AL(self):
      random.seed(1111111111110)
      # Even with random seed, the order of the following seem to be random,
      # so we shouldn't test for exact order.
      EXPECTED_CANDIDATES = [
          (
              {"name": "Willy", "age": "35"},
              {"name": "William", "age": "35"},
          ),
          (
              {"name": "Jimmy", "age": "20"},
              {"name": "Jimbo", "age": "21"},
          ),
          (
              {"name": "Willy", "age": "35"},
              {"name": "Jimmy", "age": "20"},
          ),
          (
              {"name": "William", "age": "35"},
              {"name": "Jimmy", "age": "20"},
          ),
          (
              {"name": "Meredith", "age": "40"},
              {"name": "Sue", "age": "10"},
          ),
          (
              {"name": "Meredith", "age": "40"},
              {"name": "Jimmy", "age": "20"},
          ),
          (
              {"name": "Sue", "age": "10"},
              {"name": "Jimmy", "age": "20"},
          ),
          (
              {"name": "Willy", "age": "35"},
              {"name": "Jimbo", "age": "21"},
          ),
          (
              {"name": "William", "age": "35"},
              {"name": "Jimbo", "age": "21"},
          ),
      ]
      EXPECTED_CANDIDATES = {
          freeze_record_pair(pair) for pair in EXPECTED_CANDIDATES
      }
      active_learner = labeler.DedupeDisagreementLearner(
          self.data_model.predicates,
          self.data_model.distances,
          SAMPLE,
          [],
      )
      actual_candidates = set()
      for i in range(len(EXPECTED_CANDIDATES), 0, -1):
          assert len(active_learner) == i
          record_pair = freeze_record_pair(active_learner.pop())
          actual_candidates.add(record_pair)
      assert actual_candidates == EXPECTED_CANDIDATES
      with pytest.raises(IndexError):
          active_learner.pop()
  
file_path: dedupe/tests/test_labeler.py
imports: import random
  import unittest
  import pytest
  from dedupe import datamodel, labeler
  from dedupe._typing import RecordDictPair
label_desc: Use image node_id 2 for calling the ActiveLearningTest obj's underlying member method code with example usage: obj.test_AL() without return types