class_docstr: Represents a value to be computed by dask.
  
  Equivalent to the output from a single key in a dask graph.
class_docstr_tok: ["Represents","a","value","to","be","computed","by","dask",".","Equivalent","to","the","output","from","a","single","key","in","a","dask","graph","."]
code: def __init__(self, key, dsk, length=None, layer=None):
      self._key = key
      self._dask = dsk
      self._length = length
  
      # NOTE: Layer is used by `to_delayed` in other collections, but not in normal Delayed use
      self._layer = layer or key
      if (
          isinstance(dsk, HighLevelGraph)
          and self._layer not in dsk.layers
      ):
          raise ValueError(
              f"Layer {self._layer} not in the HighLevelGraph's layers: {list(dsk.layers)}"
          )
  
imports: from __future__ import annotations
  import operator
  import types
  import uuid
  import warnings
  from collections.abc import Sequence
  from dataclasses import fields, is_dataclass, replace
  from functools import partial
  from tlz import concat, curry, merge, unique
  from dask import config
  from dask.base import DaskMethodsMixin, dont_optimize, is_dask_collection, named_schedulers, replace_name_in_key
  from dask.base import tokenize
  from dask.context import globalmethod
  from dask.core import flatten, quote
  from dask.highlevelgraph import HighLevelGraph
  from dask.typing import Graph, NestedKeys
  from dask.utils import OperatorMethodMixin, apply, funcname, is_namedtuple_instance, methodcaller
label_desc: Use image node_id 1 to create a new Delayed object from inherited base classes: DaskMethodsMixin, OperatorMethodMixin with example: obj = Delayed(key, dsk, length, layer)