docstr: Get the total number of concept drift warnings detected, or the number on an individual
  tree basis (optionally).
  
  Parameters
  ----------
  tree_id
      The number of the base learner in the ensemble: `[0, self.n_models - 1]. If `None`,
      the total number of warnings is returned instead.
  
  Returns
  -------
      The number of concept drift warnings detected.
code: def n_warnings_detected(self, tree_id: int | None = None) -> int:
      """Get the total number of concept drift warnings detected, or the number on an individual
      tree basis (optionally).
  
      Parameters
      ----------
      tree_id
          The number of the base learner in the ensemble: `[0, self.n_models - 1]. If `None`,
          the total number of warnings is returned instead.
  
      Returns
      -------
          The number of concept drift warnings detected.
  
      """
  
      if self._warning_detection_disabled:
          return 0
  
      if tree_id is None:
          return sum(self._warning_tracker.values())
  
      return self._warning_tracker[tree_id]
  
imports: from __future__ import annotations
  import abc
  import collections
  import copy
  import math
  import random
  import typing
  import numpy
  from river import base, metrics, stats
  from river.drift import ADWIN, NoDrift
  from river.tree.hoeffding_tree_classifier import HoeffdingTreeClassifier
  from river.tree.hoeffding_tree_regressor import HoeffdingTreeRegressor
  from river.tree.nodes.arf_htc_nodes import RandomLeafMajorityClass, RandomLeafNaiveBayes, RandomLeafNaiveBayesAdaptive
  from river.tree.nodes.arf_htr_nodes import RandomLeafAdaptive, RandomLeafMean, RandomLeafModel
  from river.tree.splitter import Splitter
  from river.utils.random import poisson
label_desc: Use image node_id 7 for calling the BaseForest obj's underlying member method code with example usage: obj.n_warnings_detected(tree_id) and returns: self, int, sum