def invert_permutation_indices(indices):
 inverted = ([0] * len(indices))
 for (i, index) in enumerate(indices):
  inverted[index] = i
 return inverted

def invert_permutation_indices ( indices ) : inverted = ( [ 0 ] * len ( indices ) ) for ( i , index ) in enumerate ( indices ) : inverted [ index ] = i return inverted
invert the permutation giver by indices .