class_docstr: High level graph layer
  
  This abstract class establish a protocol for high level graph layers.
  
  The main motivation of a layer is to represent a collection of tasks
  symbolically in order to speedup a series of operations significantly.
  Ideally, a layer should stay in this symbolic state until execution
  but in practice some operations will force the layer to generate all
  its internal tasks. We say that the layer has been materialized.
  
  Most of the default implementations in this class will materialize the
  layer. It is up to derived classes to implement non-materializing
  implementations.
class_docstr_tok: ["High","level","graph","layer","This","abstract","class","establish","a","protocol","for","high","level","graph","layers",".","The","main","motivation","of","a","layer","is","to","represent","a","collection","of","tasks","symbolically","in","order","to","speedup","a","series","of","operations","significantly",".","Ideally",",","a","layer","should","stay","in","this","symbolic","state","until","execution","but","in","practice","some","operations","will","force","the","layer","to","generate","all","its","internal","tasks",".","We","say","that","the","layer","has","been","materialized",".","Most","of","the","default","implementations","in","this","class","will","materialize","the","layer",".","It","is","up","to","derived","classes","to","implement","non-materializing","implementations","."]
docstr: Initialize Layer object.
  
  Parameters
  ----------
  annotations : Mapping[str, Any], optional
      By default, None.
      Annotations are metadata or soft constraints associated with tasks
      that dask schedulers may choose to respect:
      They signal intent without enforcing hard constraints.
      As such, they are primarily designed for use with the distributed
      scheduler. See the dask.annotate function for more information.
  collection_annotations : Mapping[str, Any], optional. By default, None.
      Experimental, intended to assist with visualizing the performance
      characteristics of Dask computations.
      These annotations are *not* passed to the distributed scheduler.
code: def __init__(
      self,
      annotations: Mapping[str, Any] | None = None,
      collection_annotations: Mapping[str, Any] | None = None,
  ):
      """Initialize Layer object.
  
      Parameters
      ----------
      annotations : Mapping[str, Any], optional
          By default, None.
          Annotations are metadata or soft constraints associated with tasks
          that dask schedulers may choose to respect:
          They signal intent without enforcing hard constraints.
          As such, they are primarily designed for use with the distributed
          scheduler. See the dask.annotate function for more information.
      collection_annotations : Mapping[str, Any], optional. By default, None.
          Experimental, intended to assist with visualizing the performance
          characteristics of Dask computations.
          These annotations are *not* passed to the distributed scheduler.
      """
      self.annotations = (
          annotations or dask.get_annotations().copy() or None
      )
      self.collection_annotations = collection_annotations or copy.copy(
          config.get("collection_annotations", None)
      )
  
imports: from __future__ import annotations
  import abc
  import copy
  import html
  from collections.abc import Collection, Hashable, ItemsView, Iterable, Iterator, KeysView, Mapping, Sequence, Set, ValuesView
  from typing import Any
  import tlz
  import dask
  from dask import config
  from dask.base import clone_key, flatten, is_dask_collection
  from dask.core import keys_in_tasks, reverse_dict
  from dask.typing import DaskCollection, Graph, Key
  from dask.utils import ensure_dict, import_required, key_split
  from dask.widgets import get_template
label_desc: Use image node_id 1 to create a new Layer object from inherited base classes: Graph with example: obj = Layer(annotations, collection_annotations)