import importlib


def import_cpp(name):
    """
    Import jet generated cpp as module

    Args:
      name (str)  The name (corresponding to the compile_cpp name given)

    Returns:
      Compiled and imported Python module
    """
    try:
        return importlib.import_module('jet_generated.' + name)
    except ImportError:
        raise ImportError("The module %s doesn't exist. Has it been built?" % name)