code: def _get_order_with_same_order_averaging(
      data: np.ndarray,
  ) -> np.ndarray:
      order = np.zeros_like(data, dtype=float)
      data_sorted = np.sort(data)
      for i, d in enumerate(data):
          indices = np.where(data_sorted == d)[0]
          order[i] = sum(indices) / len(indices)
      return order
  
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 2 for calling a global function with example usage: _get_order_with_same_order_averaging(data) and returns: order