hs mode in python