code: def connections_from_components_map(
      components: Dict[str, "ModelComponent"]
  ) -> List[Dict[str, str]]:
      dsk_connections = []
      for con in flatten(
          [
              comp._flashserve_meta_.connections
              for comp in components.values()
          ]
      ):
          # value of target key is mapped one-to-one from value of source
          dsk_connections.append(con._asdict())
      return dsk_connections
  
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 4 for calling a global function with example usage: connections_from_components_map(components) and returns: dsk_connections