code: def _write_estimator_html(
      out,
      estimator,
      estimator_label,
      estimator_label_details,
      first_call=False,
  ):
      """Write estimator to html in serial, parallel, or by itself (single)."""
      if first_call:
          est_block = _get_visual_block(estimator)
      else:
          with config_context(print_changed_only=True):
              est_block = _get_visual_block(estimator)
  
      if est_block.kind in ("serial", "parallel"):
          dashed_wrapped = first_call or est_block.dash_wrapped
          dash_cls = " sk-dashed-wrapped" if dashed_wrapped else ""
          out.write(f'<div class="sk-item{dash_cls}">')
  
          if estimator_label:
              _write_label_html(
                  out, estimator_label, estimator_label_details
              )
  
          kind = est_block.kind
          out.write(f'<div class="sk-{kind}">')
          est_infos = zip(
              est_block.estimators,
              est_block.names,
              est_block.name_details,
          )
  
          for est, name, name_details in est_infos:
              if kind == "serial":
                  _write_estimator_html(out, est, name, name_details)
              else:  # parallel
                  out.write('<div class="sk-parallel-item">')
                  # wrap element in a serial visualblock
                  serial_block = _VisualBlock(
                      "serial", [est], dash_wrapped=False
                  )
                  _write_estimator_html(
                      out, serial_block, name, name_details
                  )
                  out.write("</div>")  # sk-parallel-item
  
          out.write("</div></div>")
      elif est_block.kind == "single":
          _write_label_html(
              out,
              est_block.names,
              est_block.name_details,
              outer_class="sk-item",
              inner_class="sk-estimator",
              checked=first_call,
          )
  
file_path: catboost/contrib/python/scikit-learn/py3/sklearn/utils/_estimator_html_repr.py
imports: import html
  from contextlib import closing
  from inspect import isclass
  from io import StringIO
  from string import Template
  from ..None import config_context
label_desc: Use image node_id 3 for calling a global function with example usage: _write_estimator_html(out, estimator, estimator_label, estimator_label_details, first_call) without return types