Mo's algorithm implementation in Python

Can someone post their Mo’s algorithm / square root decomposition implementation in python?

//