class_docstr: A sensor applies a continuous sequence of numerical values
  to a set of associated metrics. For example a sensor on
  message size would record a sequence of message sizes using
  the `record(double)` api and would maintain a set
  of metrics about request sizes such as the average or max.
class_docstr_tok: ["A","sensor","applies","a","continuous","sequence","of","numerical","values","to","a","set","of","associated","metrics",".","For","example","a","sensor","on","message","size","would","record","a","sequence","of","message","sizes","using","the","`","record","(","double",")","`","api","and","would","maintain","a","set","of","metrics","about","request","sizes","such","as","the","average","or","max","."]
docstr: Validate that this sensor doesn't end up referencing itself.
docstr_tok: ["Validate","that","this","sensor","does","n't","end","up","referencing","itself","."]
code: def _check_forest(self, sensors):
      """Validate that this sensor doesn't end up referencing itself."""
      if self in sensors:
          raise ValueError(
              "Circular dependency in sensors: %s is its own"
              "parent." % (self.name,)
          )
      sensors.add(self)
      for parent in self._parents:
          parent._check_forest(sensors)
  
file_path: kafka-python/kafka/metrics/stats/sensor.py
imports: from __future__ import absolute_import
  import threading
  import time
  from kafka.errors import QuotaViolationError
  from kafka.metrics import KafkaMetric
label_desc: Use image node_id 2 for calling the Sensor obj's underlying member method code with example usage: obj._check_forest(sensors) without return types