code: def test_diagnostics(abcde):
      r"""
          a1  b1  c1  d1  e1
          /|\ /|\ /|\ /|  /
         / | X | X | X | /
        /  |/ \|/ \|/ \|/
      a0  b0  c0  d0  e0
      """
      a, b, c, d, e = abcde
      dsk = {
          (a, 0): (f,),
          (b, 0): (f,),
          (c, 0): (f,),
          (d, 0): (f,),
          (e, 0): (f,),
          (a, 1): (f, (a, 0), (b, 0), (c, 0)),
          (b, 1): (f, (b, 0), (c, 0), (d, 0)),
          (c, 1): (f, (c, 0), (d, 0), (e, 0)),
          (d, 1): (f, (d, 0), (e, 0)),
          (e, 1): (f, (e, 0)),
      }
      o = order(dsk)
      assert_topological_sort(dsk, o)
      info, memory_over_time = diagnostics(dsk)
      # this is ambiguous, depending on whether we start from left or right
      assert all(o[key] == val.order for key, val in info.items())
      if o[(e, 1)] == 1:
          assert o[(e, 1)] == 1
          assert o[(d, 1)] == 3
          assert o[(c, 1)] == 5
          assert memory_over_time == [0, 1, 1, 2, 2, 3, 2, 3, 2, 3]
          assert {key: val.age for key, val in info.items()} == {
              (a, 0): 1,
              (b, 0): 3,
              (c, 0): 5,
              (d, 0): 5,
              (e, 0): 5,
              (a, 1): 0,
              (b, 1): 0,
              (c, 1): 0,
              (d, 1): 0,
              (e, 1): 0,
          }
          assert {
              key: val.num_dependencies_freed
              for key, val in info.items()
          } == {
              (a, 0): 0,
              (b, 0): 0,
              (c, 0): 0,
              (d, 0): 0,
              (e, 0): 0,
              (a, 1): 3,
              (b, 1): 1,
              (c, 1): 1,
              (d, 1): 0,
              (e, 1): 0,
          }
          assert {
              key: val.num_data_when_run for key, val in info.items()
          } == {
              (a, 0): 2,
              (b, 0): 2,
              (c, 0): 2,
              (d, 0): 1,
              (e, 0): 0,
              (a, 1): 3,
              (b, 1): 3,
              (c, 1): 3,
              (d, 1): 2,
              (e, 1): 1,
          }
          assert {
              key: val.num_data_when_released
              for key, val in info.items()
          } == {
              (a, 0): 3,
              (b, 0): 3,
              (c, 0): 3,
              (d, 0): 3,
              (e, 0): 3,
              (a, 1): 3,
              (b, 1): 3,
              (c, 1): 3,
              (d, 1): 2,
              (e, 1): 1,
          }
      else:
          assert o[(e, 1)] == len(dsk) - 1
          assert o[(d, 1)] == len(dsk) - 2
          assert o[(c, 1)] == len(dsk) - 3
          assert memory_over_time == [0, 1, 2, 3, 2, 3, 2, 3, 2, 1]
          assert {key: val.age for key, val in info.items()} == {
              (a, 0): 3,
              (b, 0): 4,
              (c, 0): 5,
              (d, 0): 4,
              (e, 0): 3,
              (a, 1): 0,
              (b, 1): 0,
              (c, 1): 0,
              (d, 1): 0,
              (e, 1): 0,
          }
          assert {
              key: val.num_dependencies_freed
              for key, val in info.items()
          } == {
              (a, 0): 0,
              (b, 0): 0,
              (c, 0): 0,
              (d, 0): 0,
              (e, 0): 0,
              (a, 1): 1,
              (b, 1): 1,
              (c, 1): 1,
              (d, 1): 1,
              (e, 1): 1,
          }
          assert {
              key: val.num_data_when_run for key, val in info.items()
          } == {
              (a, 0): 0,
              (b, 0): 1,
              (c, 0): 2,
              (d, 0): 2,
              (e, 0): 2,
              (a, 1): 3,
              (b, 1): 3,
              (c, 1): 3,
              (d, 1): 2,
              (e, 1): 1,
          }
          assert {
              key: val.num_data_when_released
              for key, val in info.items()
          } == {
              (a, 0): 3,
              (b, 0): 3,
              (c, 0): 3,
              (d, 0): 2,
              (e, 0): 1,
              (a, 1): 3,
              (b, 1): 3,
              (c, 1): 3,
              (d, 1): 2,
              (e, 1): 1,
          }
  
imports: from __future__ import annotations
  import inspect
  import pytest
  import dask
  from dask import delayed
  from dask.base import collections_to_dsk, key_split, visualize_dsk
  from dask.core import get_deps
  from dask.order import _connecting_to_roots, diagnostics, ndependencies, order
  from dask.utils_test import add, inc
label_desc: Use image node_id 34 for calling a global function with example usage: test_diagnostics(abcde) without return types