code: def _create_zmap(
      x_values: list[int | float],
      y_values: list[int | float],
      z_values: list[float],
      xi: np.ndarray,
      yi: np.ndarray,
  ) -> dict[tuple[int, int], float]:
      # Creates z-map from trial values and params.
      # z-map is represented by hashmap of coordinate and trial value pairs.
      #
      # Coordinates are represented by tuple of integers, where the first item
      # indicates x-axis index and the second item indicates y-axis index
      # and refer to a position of trial value on irregular param grid.
      #
      # Since params were resampled either with linspace or logspace
      # original params might not be on the x and y axes anymore
      # so we are going with close approximations of trial value positions.
      zmap = dict()
      for x, y, z in zip(x_values, y_values, z_values):
          xindex = int(np.argmin(np.abs(xi - x)))
          yindex = int(np.argmin(np.abs(yi - y)))
          zmap[(xindex, yindex)] = z
  
      return zmap
  
imports: from __future__ import annotations
  from typing import Callable
  from typing import Sequence
  import numpy
  from optuna._experimental import experimental_func
  from optuna._imports import try_import
  from optuna.logging import get_logger
  from optuna.study import Study
  from optuna.trial import FrozenTrial
  from optuna.visualization._contour import _AxisInfo
  from optuna.visualization._contour import _ContourInfo
  from optuna.visualization._contour import _get_contour_info
  from optuna.visualization._contour import _PlotValues
  from optuna.visualization._contour import _SubContourInfo
  from optuna.visualization.matplotlib._matplotlib_imports import _imports
label_desc: Use image node_id 6 for calling a global function with example usage: _create_zmap(x_values, y_values, z_values, xi, yi) and returns: zmap