writerfilter: convert modelpreprocess to Python

Change-Id: I8c63d8d1bcf4247491e4be22d1e37e1eefe1e7d1