There are some issues with the to_fsm2oshd function (e.g. a lot of unused parameters, wrongly named parameters like fsm_mode instead of mode) etc.
This would make the whole topopyscale not work. Since I wasn't able to quick fix (and I didn't now what your goal of the function is), I outcommented the funciton for not, so the topopyscale still works.
There are some issues with the to_fsm2oshd function (e.g. a lot of unused parameters, wrongly named parameters like fsm_mode instead of mode) etc. This would make the whole topopyscale not work. Since I wasn't able to quick fix (and I didn't now what your goal of the function is), I outcommented the funciton for not, so the topopyscale still works.