code: def _get_slice_plot_info(
      study: Study,
      params: list[str] | None,
      target: Callable[[FrozenTrial], float] | None,
      target_name: str,
  ) -> _SlicePlotInfo:
      _check_plot_args(study, target, target_name)
  
      trials = _filter_nonfinite(
          study.get_trials(
              deepcopy=False, states=(TrialState.COMPLETE,)
          ),
          target=target,
      )
  
      if len(trials) == 0:
          _logger.warning(
              "Your study does not have any completed trials."
          )
          return _SlicePlotInfo(target_name, [])
  
      all_params = {
          p_name for t in trials for p_name in t.params.keys()
      }
  
      distributions = {}
      for trial in trials:
          for param_name, distribution in trial.distributions.items():
              if param_name not in distributions:
                  distributions[param_name] = distribution
  
      x_labels = {}
      for param_name, distribution in distributions.items():
          if isinstance(distribution, CategoricalDistribution):
              x_labels[param_name] = distribution.choices
  
      if params is None:
          sorted_params = sorted(all_params)
      else:
          for input_p_name in params:
              if input_p_name not in all_params:
                  raise ValueError(
                      f"Parameter {input_p_name} does not exist in your study."
                  )
          sorted_params = sorted(set(params))
  
      return _SlicePlotInfo(
          target_name=target_name,
          subplots=[
              _get_slice_subplot_info(
                  trials=trials,
                  param=param,
                  target=target,
                  log_scale=_is_log_scale(trials, param),
                  numerical=not isinstance(
                      distributions[param], CategoricalDistribution
                  ),
                  x_labels=x_labels.get(param),
              )
              for param in sorted_params
          ],
      )
  
imports: from __future__ import annotations
  from typing import Any
  from typing import Callable
  from typing import cast
  from typing import NamedTuple
  from optuna.distributions import CategoricalChoiceType
  from optuna.distributions import CategoricalDistribution
  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 _filter_nonfinite
  from optuna.visualization._utils import _is_log_scale
label_desc: Use image node_id 2 for calling a global function with example usage: _get_slice_plot_info(study, params, target, target_name) and returns: _SlicePlotInfo, _SlicePlotInfo