def pipe(engine, format, data):
    """Return data piped through Graphviz engine into format.

    Args:
        engine: The layout commmand used for rendering ('dot', 'neato', ...)
        format: The output format used for rendering ('pdf', 'png', ...)
        data: The binary (encoded) DOT source string to render.
    Returns:
        Binary (encoded) stdout of the layout command.
    Raises:
        RuntimeError: If the Graphviz executable is not found.
    """
    args, _ = command(engine, format)

    try:
        proc = subprocess.Popen(args, stdin=subprocess.PIPE,
            stdout=subprocess.PIPE, 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

    outs, errs = proc.communicate(data)

    return outs
dataset/ETHPy150Open xflr6/graphviz/graphviz/backend.py/pipe