Merge pull request #1 from nadavoid/master

Added ts_code_copy helper function