code: def ischildobject(obj: object, class_name: str) -> bool:
      """Checks weather or not the given object inherits from a class with the given class name.
  
      Workaround isinstance function to not have to import modules defining classes and become
      dependent on them. class_name is case-sensitive.
  
      Examples
      --------
  
      >>> from river import anomaly
      >>> from river import utils
  
      >>> class_name = "AnomalyDetector"
  
      >>> utils.inspect.ischildobject(obj=anomaly.HalfSpaceTrees(), class_name=class_name)
      True
  
      >>> utils.inspect.ischildobject(obj=anomaly.OneClassSVM(), class_name=class_name)
      True
  
      >>> utils.inspect.ischildobject(obj=anomaly.GaussianScorer(), class_name=class_name)
      False
  
      """
      parent_classes = inspect.getmro(obj.__class__)
      return any(cls.__name__ == class_name for cls in parent_classes)
  
file_path: river/river/utils/inspect.py
imports: from __future__ import annotations
  import inspect
  from river import base
label_desc: Use image node_id 2 for calling a global function with example usage: ischildobject(obj, class_name) and returns: any