The most common cause of this is directly referencing the global variable word_embeddings
in the body of your get_country
function. What if the grader passes a different embeddings dictionary?
In these courses referencing global variables in the local scope of your functions is always a mistake. It may work in the notebook, but the point is that the code is not general.