code: def to_html(obj) -> ET.Element:
      from river import base, compose
  
      if isinstance(obj, compose.Pipeline):
          return pipeline_to_html(obj)
      if isinstance(obj, compose.TransformerUnion):
          return union_to_html(obj)
      if isinstance(obj, base.Wrapper):
          return wrapper_to_html(obj)
      return estimator_to_html(obj)
  
file_path: river/river/base/viz.py
imports: from __future__ import annotations
  import inspect
  import textwrap
  from xml.etree import ElementTree
label_desc: Use image node_id 1 for calling a global function with example usage: to_html(obj) and returns: estimator_to_html, pipeline_to_html, union_to_html, wrapper_to_html