This is the code that accompanies the book. https://www.amazon.com/Analyzing-Neural-Time-Data-Practice/dp/0262019876
Check this link for a full Python translation of the book code: https://agencyenterprise.github.io/AnalyzingNeuralTimeSeries-Python/