import importlib
module_names = [('math',), ('numpy','np')]
def Importer(m_name):
module = importlib.import_module(m_name[0])
if len(m_name) > 1:
globals()[x[1]] = module
for x in module_names:
Importer(x)
names = getattr(foo, '__all__', [])
if not names:
names = [n for n in foo.__dict__.keys() if n[:1] != '_']
for name in names:
globals()[name] = getattr(foo, name)
import different backends with same alias
https://stackoverflow.com/questions/72106437/dynamically-assigning-module-names-as-aliases