I imported your function and then commented out all the lines, found it was ok, so uncommented lines till the problem occurred.
The thread about the octal issue is Function node flags octal assignments with leading 0's, warns at deploy but runs fine