def try_import(import_str, default=None):
    try:
        return import_module(import_str)
    except ImportError:
        return default
Try to import a module and if it fails return default.
dataset/ETHPy150Open openstack-dev/heat-cfnclient/heat_cfnclient/openstack/common/importutils.py/try_import