def get(dsk: dict, out: Sequence[str], cache: dict = None, sortkeys: List[str] = None):
    """Get value from the task graphs.

    Parameters
    ----------
    dsk
        task graph dict
    out
        sequence of output keys which should be retrieved as results of running
        `get()` over the `dsk`.
    cache
        cache dict for fast in-memory lookups of previously computed results.
    sortkeys
        topologically sorted keys

    Examples
    --------
    >>> from flash.core.serve.dag.utils_test import inc
    >>> d = {'x': 1, 'y': (inc, 'x')}
    >>> get(d, 'x')
    1
    >>> get(d, 'y')
    2
    >>> get(d, 'y', sortkeys=['x', 'y'])
    2

    """
    for k in flatten(out) if isinstance(out, list) else [out]:
        if k not in dsk:
            raise KeyError(f"{k} is not a key in the graph")
    if cache is None:
        cache = {}
    if sortkeys is None:
        sortkeys = toposort(dsk)
    for key in sortkeys:
        task = dsk[key]
        result = _execute_task(task, cache)
        cache[key] = result
    result = _execute_task(out, cache)
    if isinstance(out, list):
        result = lists_to_tuples(result, out)
    return result
Get value from the task graphs.

    Parameters
    ----------
    dsk
        task graph dict
    out
        sequence of output keys which should be retrieved as results of running
        `get()` over the `dsk`.
    cache
        cache dict for fast in-memory lookups of previously computed results.
    sortkeys
        topologically sorted keys

    Examples
    --------
    >>> from flash.core.serve.dag.utils_test import inc
    >>> d = {'x': 1, 'y': (inc, 'x')}
    >>> get(d, 'x')
    1
    >>> get(d, 'y')
    2
    >>> get(d, 'y', sortkeys=['x', 'y'])
    2

    
src/flash/core/serve/dag/task.py