I used importlib package in my program to execute user functions dynamiclly, as shown below.
modules = defaultdict() if module_path not in modules: module