trees in python