code: def _get_improvement_scatter(
      trial_numbers: list[int],
      improvements: list[float],
      opacity: float = 1.0,
      showlegend: bool = True,
  ) -> "go.Scatter":
      plotly_blue_with_opacity = f"rgba(99, 110, 250, {opacity})"
      return go.Scatter(
          x=trial_numbers,
          y=improvements,
          mode="markers+lines",
          marker=dict(color=plotly_blue_with_opacity),
          line=dict(color=plotly_blue_with_opacity),
          name="Terminator Improvement",
          showlegend=showlegend,
          legendgroup="improvement",
      )
  
imports: from __future__ import annotations
  from typing import NamedTuple
  import tqdm
  import optuna
  from optuna._experimental import experimental_func
  from optuna.logging import get_logger
  from optuna.study.study import Study
  from optuna.terminator import BaseErrorEvaluator
  from optuna.terminator import BaseImprovementEvaluator
  from optuna.terminator import CrossValidationErrorEvaluator
  from optuna.terminator import RegretBoundEvaluator
  from optuna.terminator.improvement.evaluator import DEFAULT_MIN_N_TRIALS
  from optuna.visualization._plotly_imports import _imports
label_desc: Use image node_id 3 for calling a global function with example usage: _get_improvement_scatter(trial_numbers, improvements, opacity, showlegend) and returns: go