got internals/states.py from mattjj/pyhsmm