Extract the motion sections of python mode