code: def test_ordering_keeps_groups_together(abcde):
      a, b, c, d, e = abcde
      d = {(a, i): (f,) for i in range(4)}
      d.update(
          {(b, 0): (f, (a, 0), (a, 1)), (b, 1): (f, (a, 2), (a, 3))}
      )
      o = order(d)
  
      assert abs(o[(a, 0)] - o[(a, 1)]) == 1
      assert abs(o[(a, 2)] - o[(a, 3)]) == 1
  
      d = {(a, i): (f,) for i in range(4)}
      d.update(
          {(b, 0): (f, (a, 0), (a, 2)), (b, 1): (f, (a, 1), (a, 3))}
      )
      o = order(d)
  
      assert abs(o[(a, 0)] - o[(a, 2)]) == 1
      assert abs(o[(a, 1)] - o[(a, 3)]) == 1
  
imports: import pytest
  from flash.core.serve.dag.order import ndependencies, order
  from flash.core.serve.dag.task import get, get_deps
  from flash.core.serve.dag.utils_test import add, inc
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 4 for calling a global function with example usage: test_ordering_keeps_groups_together(abcde) without return types