I'm probably missing some context... why don't you assign the dict below to d directly? It looks like d has already all the possible keys