code: def _verify_no_cycles(
      dsk: Dict[str, tuple], out_keys: List[str], endpoint_name: str
  ):
      if not isdag(dsk, keys=out_keys):
          cycle = getcycle(dsk, keys=out_keys)
          raise RuntimeError(
              f"Cycle detected when attepting to build DAG for endpoint: "
              f"`{endpoint_name}`. This cycle is formed by connections between "
              f"the following nodes: {cycle}"
          )
  
imports: from collections import defaultdict
  from dataclasses import dataclass
  from operator import attrgetter
  from typing import TYPE_CHECKING, Dict, List, Set, Tuple
  from flash.core.serve.dag.optimization import cull, functions_of, inline_functions
  from flash.core.serve.dag.rewrite import RewriteRule, RuleSet
  from flash.core.serve.dag.task import flatten, get_deps, getcycle, isdag, toposort
  from flash.core.serve.dag.utils import funcname
  from flash.core.utilities.imports import _CYTOOLZ_AVAILABLE, _PYDANTIC_AVAILABLE
label_desc: Use image node_id 3 for calling a global function with example usage: _verify_no_cycles(dsk, out_keys, endpoint_name) without return types