allow python template to work with v2 and v3