code: def _get_rank_subplot_info(
      trials: list[FrozenTrial],
      target_values: np.ndarray,
      colors: np.ndarray,
      x_param: str,
      y_param: str,
  ) -> _RankSubplotInfo:
      xaxis = _get_axis_info(trials, x_param)
      yaxis = _get_axis_info(trials, y_param)
  
      infeasible_trial_ids = []
      for i in range(len(trials)):
          constraints = trials[i].system_attrs.get(_CONSTRAINTS_KEY)
          if constraints is not None and any(
              [x > 0.0 for x in constraints]
          ):
              infeasible_trial_ids.append(i)
  
      colors[infeasible_trial_ids] = (
          204,
          204,
          204,
      )  # equal to "#CCCCCC"
  
      filtered_ids = [
          i
          for i in range(len(trials))
          if x_param in trials[i].params and y_param in trials[i].params
      ]
      filtered_trials = [trials[i] for i in filtered_ids]
      xs = [trial.params[x_param] for trial in filtered_trials]
      ys = [trial.params[y_param] for trial in filtered_trials]
      zs = target_values[filtered_ids]
      colors = colors[filtered_ids]
      return _RankSubplotInfo(
          xaxis=xaxis,
          yaxis=yaxis,
          xs=xs,
          ys=ys,
          trials=filtered_trials,
          zs=np.array(zs),
          colors=colors,
      )
  
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 4 for calling a global function with example usage: _get_rank_subplot_info(trials, target_values, colors, x_param, y_param) and returns: _RankSubplotInfo