code: def test_sort_by_index() -> None:
      nodes = [
          VectorNode(3, [1, 2, 3]),
          VectorNode(3, [2, 3, 1]),
          VectorNode(3, [3, 1, 2]),
      ]
      new_nodes = VectorLinkedList.sort_by_index(nodes, 0)
      assert new_nodes == nodes
  
      new_nodes = VectorLinkedList.sort_by_index(nodes, 1)
      assert new_nodes == [nodes[2], nodes[0], nodes[1]]
  
      new_nodes = VectorLinkedList.sort_by_index(nodes, 2)
      assert new_nodes == [nodes[1], nodes[2], nodes[0]]
  
file_path: nevergrad/nevergrad/optimization/multiobjective/test_hypervolume.py
imports: import numpy
  from .hypervolume import VectorNode, VectorLinkedList, HypervolumeIndicator
label_desc: Use image node_id 12 for calling a global function with example usage: test_sort_by_index() without return types