code: def test_make_hovertext() -> None:
      trial_no_user_attrs = FrozenTrial(
          number=0,
          trial_id=0,
          state=TrialState.COMPLETE,
          value=0.2,
          datetime_start=datetime.datetime.now(),
          datetime_complete=datetime.datetime.now(),
          params={"x": 10},
          distributions={"x": FloatDistribution(5, 12)},
          user_attrs={},
          system_attrs={},
          intermediate_values={},
      )
      assert (
          _make_hovertext(trial_no_user_attrs)
          == dedent(
              """
          {
            "number": 0,
            "values": [
              0.2
            ],
            "params": {
              "x": 10
            }
          }
          """
          )
          .strip()
          .replace("\n", "<br>")
      )
  
      trial_user_attrs_valid_json = FrozenTrial(
          number=0,
          trial_id=0,
          state=TrialState.COMPLETE,
          value=0.2,
          datetime_start=datetime.datetime.now(),
          datetime_complete=datetime.datetime.now(),
          params={"x": 10},
          distributions={"x": FloatDistribution(5, 12)},
          user_attrs={"a": 42, "b": 3.14},
          system_attrs={},
          intermediate_values={},
      )
      assert (
          _make_hovertext(trial_user_attrs_valid_json)
          == dedent(
              """
          {
            "number": 0,
            "values": [
              0.2
            ],
            "params": {
              "x": 10
            },
            "user_attrs": {
              "a": 42,
              "b": 3.14
            }
          }
          """
          )
          .strip()
          .replace("\n", "<br>")
      )
  
      trial_user_attrs_invalid_json = FrozenTrial(
          number=0,
          trial_id=0,
          state=TrialState.COMPLETE,
          value=0.2,
          datetime_start=datetime.datetime.now(),
          datetime_complete=datetime.datetime.now(),
          params={"x": 10},
          distributions={"x": FloatDistribution(5, 12)},
          user_attrs={
              "a": 42,
              "b": 3.14,
              "c": np.zeros(1),
              "d": np.nan,
          },
          system_attrs={},
          intermediate_values={},
      )
      assert (
          _make_hovertext(trial_user_attrs_invalid_json)
          == dedent(
              """
          {
            "number": 0,
            "values": [
              0.2
            ],
            "params": {
              "x": 10
            },
            "user_attrs": {
              "a": 42,
              "b": 3.14,
              "c": "[0.]",
              "d": NaN
            }
          }
          """
          )
          .strip()
          .replace("\n", "<br>")
      )
  
imports: import datetime
  import logging
  from textwrap import dedent
  from typing import cast
  import numpy
  import pytest
  from pytest import LogCaptureFixture
  import optuna
  from optuna.distributions import FloatDistribution
  from optuna.study import create_study
  from optuna.testing.visualization import prepare_study_with_trials
  from optuna.trial import create_trial
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
  from optuna.visualization import is_available
  from optuna.visualization._utils import _check_plot_args
  from optuna.visualization._utils import _filter_nonfinite
  from optuna.visualization._utils import _is_log_scale
  from optuna.visualization._utils import _make_hovertext
label_desc: Use image node_id 9 for calling a global function with example usage: test_make_hovertext() without return types