Run a Python function in multiple ontologies

Hi folks, I have a python function from the code repository and I want to use the same function in multiple ontologies, that is, I want to reuse my function. I read in the documentation that interface is not possible in python function, do you have any ideas or suggestions?