code: def test_crowding_distance_sort() -> None:
      trials = [
          _create_frozen_trial(0, [5]),
          _create_frozen_trial(1, [6]),
          _create_frozen_trial(2, [9]),
          _create_frozen_trial(3, [0]),
      ]
      multi_objective.samplers._nsga2._crowding_distance_sort(trials)
      assert [t.number for t in trials] == [2, 3, 0, 1]
  
      trials = [
          _create_frozen_trial(0, [5, 0]),
          _create_frozen_trial(1, [6, 0]),
          _create_frozen_trial(2, [9, 0]),
          _create_frozen_trial(3, [0, 0]),
      ]
      multi_objective.samplers._nsga2._crowding_distance_sort(trials)
      assert [t.number for t in trials] == [2, 3, 0, 1]
  
file_path: optuna/tests/multi_objective_tests/samplers_tests/test_nsga2.py
imports: from collections import Counter
  from typing import List
  from typing import Tuple
  from unittest.mock import patch
  import pytest
  import optuna
  from optuna import multi_objective
  from optuna.study._study_direction import StudyDirection
label_desc: Use image node_id 6 for calling a global function with example usage: test_crowding_distance_sort() without return types