code: def test_string_ordering_dependents():
      """Prefer ordering tasks by name first even when in dependencies"""
      # XFAIL This is a little too artificial. While we can construct the
      # algorithm in a way that respects the key ordering strictly, there is not
      # necessarily a point to it and we can save ourselves one sorting step with
      # this.
      # See comment in add_to_result
      dsk = {
          ("a", 1): (f, "b"),
          ("a", 2): (f, "b"),
          ("a", 3): (f, "b"),
          "b": (f,),
      }
      o = order(dsk)
      assert_topological_sort(dsk, o)
      assert o == {
          "b": 0,
          ("a", 1): 1,
          ("a", 2): 2,
          ("a", 3): 3,
      } or o == {
          "b": 0,
          ("a", 1): 3,
          ("a", 2): 2,
          ("a", 3): 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 21 for calling a global function with example usage: test_string_ordering_dependents() without return types