Pickle classes to ERTS records