Course 1, Week 3, Exercise 5 grader/test glitch?

What “global” are you referring to? We only deal with A2 and Y here, which are parameters to the function, right?

m is not a global: it is defined by the template code that they gave you and uses Y.shape[1]. Well, unless you deleted that line. In that case, you should get a clean copy and compare. There is a procedure for that on the FAQ Thread.