code: def filter_html(value: Any) -> str:
      """Jinja filter to try and get an HTML representation of an object while respecting the
      preferred precedence: ``obj.html``, ``obj._repr_html_``, ``str(obj)``.
  
      Args:
          value (Any): The object to represent as HTML.
  
      Returns:
          str: Object's HTML representation.
  
      """
      if value is None:
          return ""
      try:
          return str(getattr(value, "html"))
      except AttributeError:
          pass
      try:
          return str(getattr(value, "_repr_html_")())
      except AttributeError:
          pass
      return str(value)
  
file_path: tslumen/tslumen/jinja_utils.py
imports: from math import ceil, log10, floor
  from typing import List, Optional, Any, Tuple
  from datetime import datetime
  import re
  import numpy
  import pandas
  import jinja2
label_desc: Use image node_id 4 for calling a global function with example usage: filter_html(value) and returns: str, str, str, str