code: def perform_test(drift_detector, data_stream):
      detected_indices = []
      for i, val in enumerate(data_stream):
          drift_detector.update(val)
          if drift_detector.drift_detected:
              detected_indices.append(i)
      return detected_indices
  
file_path: river/river/drift/test_drift_detectors.py
imports: from __future__ import annotations
  import numpy
  import pytest
  from river import drift
label_desc: Use image node_id 9 for calling a global function with example usage: perform_test(drift_detector, data_stream) and returns: detected_indices