translate FractalTransform fully into pure python