Python tools for Z-set