py stuff from ctm