Add the folding in python.