added ts_utils.py for release 2