code: def test_nsga2_ranking() -> None:
      candidates, expected_frontiers = get_nsga2_test_case_data()
      rank_result = nsga2.rank(candidates, len(candidates))
  
      assert len(rank_result) == len(candidates)
      for i, frontier in enumerate(expected_frontiers):
          for c in frontier:
              assert rank_result[c.uid][0] == i
  
file_path: nevergrad/nevergrad/optimization/multiobjective/test_nsga2.py
imports: import random
  import numpy
  import nevergrad
  import nevergrad.common.typing
  from nevergrad.parametrization import parameter
  from .None import nsga2
label_desc: Use image node_id 4 for calling a global function with example usage: test_nsga2_ranking() without return types