Rewrite python module