code: def test_cross_validation_evaluator(direction: str) -> None:
      study = create_study(direction=direction)
      sign = 1 if direction == "minimize" else -1
      study.add_trials(
          [
              _create_trial(
                  value=sign * 2.0, cv_scores=[1.0, -1.0]
              ),  # Second best trial with 1.0 var.
              _create_trial(
                  value=sign * 1.0, cv_scores=[2.0, -2.0]
              ),  # Best trial with 4.0 var.
          ]
      )
  
      evaluator = CrossValidationErrorEvaluator()
      serror = evaluator.evaluate(study.trials, study.direction)
  
      expected_scale = 1.5
      assert serror == math.sqrt(4.0 * expected_scale)
  
file_path: optuna/tests/terminator_tests/test_erroreval.py
imports: from __future__ import annotations
  import math
  import pytest
  from optuna.study.study import create_study
  from optuna.terminator import CrossValidationErrorEvaluator
  from optuna.terminator import report_cross_validation_scores
  from optuna.terminator import StaticErrorEvaluator
  from optuna.terminator.erroreval import _CROSS_VALIDATION_SCORES_KEY
  from optuna.trial import create_trial
  from optuna.trial import FrozenTrial
label_desc: Use image node_id 2 for calling a global function with example usage: test_cross_validation_evaluator(direction) without return types