C1W2 - "name 'StopCallback' is not defined

Anyone know how to define ‘StopCallback’?

[code removed - moderator]

See this

I still have the error: ‘StopCallback’ is not defined.
In the "Create and Train your Model section the line: history = model.fit(x_train, y_train, epochs=10, callbacks=[StopCallback]) causes the error of StopCallback is not defined.
When I remove “callbacks=[StopCallback]” the program can execute the 10 epochs but it wont stop executing becase the callback function isn’t there.
Subsequently, another error is presented which is: return history.epoch, history.history[‘acc’][-1] and the error is a SyntaxError: ‘return’ outside function
A third error is TypeError: train_mnist() takes 0 positional arguments but 2 were given based on the following line: hist = train_mnist(x_train, y_train)
Any suggestions

Any suggestions?

Please read this link to know the difference between a class and an object in python.

Thank your for your kind response
I had to reset my worksheet and start fresh but now getting new errors …and will make another post in an already created topic of
TypeError: set_model() missing 1 required positional argument: 'model