We can have a file with all the functions implemented and then launch the run() function only if the file was executed as a stand-alone script.

examples/functions/mymodule.py
from __future__ import print_function

def run():
    print("run in ", __name__)

print("Name space in mymodule.py ", __name__)

if __name__ == '__main__':
    run()

$ python mymodule.py
Name space in mymodule.py  __main__
run in  __main__