def _af_invert(a):
 inv_form = ([0] * len(a))
 for (i, ai) in enumerate(a):
  inv_form[ai] = i
 return inv_form

def _af_invert ( a ) : inv_form = ( [ 0 ] * len ( a ) ) for ( i , ai ) in enumerate ( a ) : inv_form [ ai ] = i return inv_form
finds the inverse .