Update python utils to deal with repeated source