def get_deployment_engine_class(provider):
    """
    Import an engine by name
    :provider: The provider you want to deploy to
    :type provider: str
    :returns: The deployment Engine
    :rtype: cactus.deployment.engine.BaseDeploymentEngine
    """
    engine_path = PROVIDER_MAPPING.get(provider, None)
    logger.debug("Loading Deployment Engine for %s: %s", provider, engine_path)

    if engine_path is None:
        return None

    module, engine = engine_path.rsplit(".", 1)

    try:
        _mod = __import__(module, fromlist=[engine])
    except ImportError as e:
        logger.error("Unable to import requested engine (%s) for provider %s", engine, provider)
        logger.error("A required library was missing: %s", e.message)
        logger.error("Please install the library and try again")
    else:
        return getattr(_mod, engine)
dataset/ETHPy150Open koenbok/Cactus/cactus/deployment/__init__.py/get_deployment_engine_class/original