code: def test_drift_adaptation_hatc():
      rng = random.Random(42)
      dataset = iter(
          synth.Sine(seed=8, classification_function=0, has_noise=True)
      )
  
      model = tree.HoeffdingAdaptiveTreeClassifier(
          leaf_prediction="mc",
          grace_period=10,
          drift_detector=drift.ADWIN(0.1),
          delta=0.1,
          drift_window_threshold=2,
          seed=42,
          max_depth=3,
      )
  
      for i in range(1000):
          if i % 200 == 0 and i > 0:
              dataset = iter(
                  synth.Sine(
                      seed=8,
                      classification_function=rng.randint(0, 3),
                      has_noise=False,
                  )
              )
  
          x, y = next(dataset)
          model.learn_one(x, y)
  
      assert model._n_switch_alternate_trees > 0
  
file_path: river/river/tree/test_trees.py
imports: from __future__ import annotations
  import random
  import pytest
  from river import drift, tree
  from river.datasets import synth
label_desc: Use image node_id 7 for calling a global function with example usage: test_drift_adaptation_hatc() without return types