code: def _use_html_if_available(format_fn):
          
          def format_using_as_html(v, label=False):
              if not label and hasattr(v, 'as_html'):
                  return v.as_html()
              else:
                  return format_fn(v, label)
          return format_using_as_html
docs: Use the value's HTML rendering if available, overriding format_fn.