looks like you had a superfluous parenthesis in line 87. I do not want to install additional packages that would be required to run your example so I cannot check if fixing that bug actually helps.
Also, I would recommend to follow SO's 'How to Ask a Good Question' guidelines (https://stackoverflow.com/help/how-to-ask) to make it easier for others to help you with your question (part of that would be to make a small, reproducable example of your bug that does not require the import of multiple external modules).