def tet10(data):
    """
    Reorder the vertex nodes so that n[0] < n[1] < n[2] < n[4].
    The order of the edge nodes n[4:10] is changed such that the cells
    still form a valid Tet10.

    Tetrahedron10:

                   v
                 .
               ,/
              /
           2
         ,/|`\\
       ,/  |  `\\
     ,6    '.   `5
   ,/       9     `\\
 ,/         |       `\\
0--------4--'.--------1 --> u
 `\\.         |      ,/
    `\\.      |    ,8
       `7.   '. ,/
          `\\. |/
             `3
                `\\.
                   ` w
    """
    n_swaps = 0
    for n in data:
        if n[0] > n[1]:
            n[0], n[1] = n[1], n[0]
            n[5], n[6] = n[6], n[5]
            n[8], n[7] = n[7], n[8]
            n_swaps += 3
        if n[2] > n[3]:
            n[2], n[3] = n[3], n[2]
            n[6], n[7] = n[7], n[6]
            n[5], n[8] = n[8], n[5]
            n_swaps += 3
        if n[0] > n[2]:
            n[0], n[2] = n[2], n[0]
            n[7], n[9] = n[9], n[7]
            n[4], n[5] = n[5], n[4]
            n_swaps += 3
        if n[1] > n[3]:
            n[1], n[3] = n[3], n[1]
            n[5], n[9] = n[9], n[5]
            n[4], n[7] = n[7], n[4]
            n_swaps += 3
        if n[1] > n[2]:
            n[1], n[2] = n[2], n[1]
            n[8], n[9] = n[9], n[8]
            n[4], n[6] = n[6], n[4]
            n_swaps += 3
    return n_swaps
