def map_indices_py(arr):
 return dict([(x, i) for (i, x) in enumerate(arr)])

def map_indices_py ( arr ) : return dict ( [ ( x , i ) for ( i , x ) in enumerate ( arr ) ] )
returns a dictionary with pairs for each element in the given array/list .