Ok it's an old one but as I've found a solution...
1- Write your function code in test_code1.py for example, with a function dazi() inside.
2- Write your program code and on the top :
from apps import test_code1
3- when you want to use your dazi function, write then test_code1.dazi('.........../......')
It's working for me.