python get index from value in dict