def render(engine, format, filepath):
    """Render file with Graphviz engine into format,  return result filename.

    Args:
        engine: The layout commmand used for rendering ('dot', 'neato', ...).
        format: The output format used for rendering ('pdf', 'png', ...).
        filepath: Path to the DOT source file to render.
    Returns:
        The (possibly relative) path of the rendered file.
    Raises:
        RuntimeError: If the Graphviz executable is not found.
    """
    args, rendered = command(engine, format, filepath)

    try:
        subprocess.call(args, startupinfo=STARTUPINFO)
    except __HOLE__ as e:
        if e.errno == errno.ENOENT:
            raise RuntimeError('failed to execute %r, '
                'make sure the Graphviz executables '
                'are on your systems\' path' % args)
        else:  # pragma: no cover
            raise

    return rendered
dataset/ETHPy150Open xflr6/graphviz/graphviz/backend.py/render