code: def _get_contour_subplot_info(
      study: Study,
      trials: list[FrozenTrial],
      x_param: str,
      y_param: str,
      target: Callable[[FrozenTrial], float] | None,
  ) -> _SubContourInfo:
      xaxis = _get_axis_info(trials, x_param)
      yaxis = _get_axis_info(trials, y_param)
  
      if x_param == y_param:
          return _SubContourInfo(xaxis=xaxis, yaxis=yaxis, z_values={})
  
      if len(xaxis.indices) < 2:
          _logger.warning(
              "Param {} unique value length is less than 2.".format(
                  x_param
              )
          )
          return _SubContourInfo(xaxis=xaxis, yaxis=yaxis, z_values={})
      if len(yaxis.indices) < 2:
          _logger.warning(
              "Param {} unique value length is less than 2.".format(
                  y_param
              )
          )
          return _SubContourInfo(xaxis=xaxis, yaxis=yaxis, z_values={})
  
      z_values: dict[tuple[int, int], float] = {}
      for i, trial in enumerate(trials):
          if x_param not in trial.params or y_param not in trial.params:
              continue
          x_value = xaxis.values[i]
          y_value = yaxis.values[i]
          assert x_value is not None
          assert y_value is not None
          x_i = xaxis.indices.index(x_value)
          y_i = yaxis.indices.index(y_value)
  
          if target is None:
              value = trial.value
          else:
              value = target(trial)
          assert value is not None
  
          existing = z_values.get((x_i, y_i))
          if existing is None or target is not None:
              # When target function is present, we can't be sure what the z-value
              # represents and therefore we don't know how to select the best one.
              z_values[(x_i, y_i)] = value
          else:
              z_values[(x_i, y_i)] = (
                  min(existing, value)
                  if study.direction is StudyDirection.MINIMIZE
                  else max(existing, value)
              )
  
      return _SubContourInfo(
          xaxis=xaxis,
          yaxis=yaxis,
          z_values=z_values,
          constraints=[_satisfy_constraints(t) for t in trials],
      )
  
imports: from __future__ import annotations
  import math
  from typing import Any
  from typing import Callable
  from typing import NamedTuple
  from optuna.logging import get_logger
  from optuna.samplers._base import _CONSTRAINTS_KEY
  from optuna.study import Study
  from optuna.study import StudyDirection
  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
  from optuna.visualization._utils import _is_numerical
  from optuna.visualization._utils import _is_reverse_scale
label_desc: Use image node_id 6 for calling a global function with example usage: _get_contour_subplot_info(study, trials, x_param, y_param, target) and returns: _SubContourInfo, _SubContourInfo, _SubContourInfo, _SubContourInfo