code: def register_formatters():
      """Register HTML notebook formatters for TFX classes.
  
      This method registers HTML formatters for TFX classes for display in
      IPython / Jupyter / Colab notebooks. No action will be performed if called
      outside a notebook environment.
      """
      if getattr(builtins, "__IPYTHON__", None):
          # Skip registration if (1) IPython is not installed or (2) if IPython is
          # installed but we are not running in the notebook context (in this case,
          # get_ipython() returns None).
          try:
              ipython = __import__(
                  "IPython.core.getipython"
              ).get_ipython()
              if not ipython:
                  return
          except ImportError:
              return
          html_formatter = ipython.display_formatter.formatters[
              "text/html"
          ]
          for cls, formatter in FORMATTER_REGISTRY.items():
              html_formatter.for_type(cls, formatter.render)
  
file_path: tfx/tfx/orchestration/experimental/interactive/notebook_formatters.py
imports: import builtins
  import html
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
  from tfx.dsl.components.base.base_component import BaseComponent
  from tfx.orchestration.experimental.interactive.execution_result import ExecutionResult
  from tfx.types.artifact import Artifact
  from tfx.types.channel import Channel
label_desc: Use image node_id 2 for calling a global function with example usage: register_formatters() without return types