code: def test_nsga2_ranking_3() -> None:
      candidates, expected_frontiers = get_nsga2_test_case_data()
      rank_result = nsga2.rank(candidates, None)
  
      assert len(rank_result) == len(candidates)
      for i, frontier in enumerate(expected_frontiers):
          expect_n_non_inf = max(0, len(frontier) - 2)
          n_non_inf = 0
          for c in frontier:
              assert rank_result[c.uid][1] == i
              if rank_result[c.uid][2] != float("inf"):
                  n_non_inf += 1
          assert n_non_inf == expect_n_non_inf
  
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 6 for calling a global function with example usage: test_nsga2_ranking_3() without return types