Coding Theory math tilities in python