code: def _get_rank_subplot(
      info: _RankSubplotInfo,
      target_name: str,
      print_raw_objectives: bool,
  ) -> "Scatter":
      def get_hover_text(
          trial: FrozenTrial, target_value: float
      ) -> str:
          lines = [f"Trial #{trial.number}"]
          lines += [f"{k}: {v}" for k, v in trial.params.items()]
          lines += [f"<b>{target_name}: {target_value}</b>"]
          if print_raw_objectives:
              lines += [
                  f"Objective #{i}: {v}"
                  for i, v in enumerate(trial.values)
              ]
          return "<br>".join(lines)
  
      scatter = go.Scatter(
          x=info.xs,
          y=info.ys,
          marker={
              "color": list(map(plotly.colors.label_rgb, info.colors)),
              "line": {"width": 0.5, "color": "Grey"},
          },
          mode="markers",
          showlegend=False,
          hovertemplate="%{hovertext}<extra></extra>",
          hovertext=[
              get_hover_text(trial, target_value)
              for trial, target_value in zip(info.trials, info.zs)
          ],
      )
      return scatter
  
imports: from __future__ import annotations
  import math
  import typing
  from typing import Any
  from typing import Callable
  from typing import NamedTuple
  import numpy
  from optuna._experimental import experimental_func
  from optuna.logging import get_logger
  from optuna.samplers._base import _CONSTRAINTS_KEY
  from optuna.study import Study
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
  from optuna.visualization._plotly_imports import _imports
  from optuna.visualization._utils import _check_plot_args
  from optuna.visualization._utils import _is_log_scale
  from optuna.visualization._utils import _is_numerical
  from optuna.visualization.matplotlib._matplotlib_imports import _imports
label_desc: Use image node_id 6 for calling a global function with example usage: _get_rank_subplot(info, target_name, print_raw_objectives) and returns: scatter, str