def include(recipe_file, _globals=None, _locals=None, prepend_path=True,
            raise_exceptions=False):
    """Include a recipe file

    # Arguments

    recipe_file: path to a recipe file (required)

    _globals: a dictionary representing the global symbol table

    _locals: a dictionary representing the local symbol table

    prepend_path: If True, prepend the path of the main recipe to the
    recipe_file. If the recipe_file is an absolute path, then the path
    is not prepended regardless of the value of this parameter.

    raise_exceptions: If False, do not print stack traces when an
    exception is raised.  The default value is False.

    """

    if _locals is None:
        # caller's locals
        _locals = sys._getframe(1).f_locals
    if _globals is None:
        # caller's globals
        _globals = sys._getframe(1).f_globals

    # If a recipe file is included from another recipe file, some way
    # is needed to find the included recipe if it specified using a
    # relative path (relative to the including recipe file). Since
    # recipe files are exec'ed, the value of __file__ is this file,
    # not the recipe file. In order to make including recipes in other
    # recipes using relative paths more intuitive, prepend the path of
    # the base recipe file.
    if (prepend_path and hasattr(include, 'prepend_path')
        and not os.path.isabs(recipe_file)):
        recipe_file = os.path.join(include.prepend_path, recipe_file)

    try:
        with open(recipe_file) as f:
            # pylint: disable=exec-used
            exec(compile(f.read(), recipe_file, 'exec'), _globals, _locals)
    except Exception as e:
        if raise_exceptions:
            raise_from(e, e)
        else:
            traceback.print_exc()
            exit(1)
Include a recipe file

    # Arguments

    recipe_file: path to a recipe file (required)

    _globals: a dictionary representing the global symbol table

    _locals: a dictionary representing the local symbol table

    prepend_path: If True, prepend the path of the main recipe to the
    recipe_file. If the recipe_file is an absolute path, then the path
    is not prepended regardless of the value of this parameter.

    raise_exceptions: If False, do not print stack traces when an
    exception is raised.  The default value is False.

    
hpccm/recipe.py