def import_modules(modules, safe=True):
    '''Safely import a list of *modules*
    '''
    all = []
    for mname in modules:
        if mname.endswith('.*'):
            to_load = expand_star(mname)
        else:
            to_load = [mname]
        for module in to_load:
            try:
                all.append(import_module(module))
            except __HOLE__:
                if not safe:
                    raise
    return all
dataset/ETHPy150Open quantmind/pulsar/pulsar/utils/importer.py/import_modules