code: def test_order_cycle():
      with pytest.raises(RuntimeError, match="Cycle detected"):
          get({"a": (f, "a")}, "a")  # we encounter this in `get`
      with pytest.raises(RuntimeError, match="Cycle detected"):
          order({"a": (f, "a")})  # trivial self-loop
      with pytest.raises(RuntimeError, match="Cycle detected"):
          order({("a", 0): (f, ("a", 0))})  # non-string
      with pytest.raises(RuntimeError, match="Cycle detected"):
          order(
              {"a": (f, "b"), "b": (f, "c"), "c": (f, "a")}
          )  # non-trivial loop
      with pytest.raises(RuntimeError, match="Cycle detected"):
          order(
              {"a": (f, "b"), "b": (f, "c"), "c": (f, "a", "d"), "d": 1}
          )
      with pytest.raises(RuntimeError, match="Cycle detected"):
          order(
              {
                  "a": (f, "b"),
                  "b": (f, "c"),
                  "c": (f, "a", "d"),
                  "d": (f, "b"),
              }
          )
  
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 27 for calling a global function with example usage: test_order_cycle() without return types