code: def from_spec(spec: dict[str, t.Any]) -> IODescriptor[t.Any]:
      if "id" not in spec:
          raise InvalidArgument(
              f"IO descriptor spec ({spec}) missing ID."
          )
  
      if spec["id"] is None:
          raise InvalidArgument("No IO descriptor spec found.")
  
      return IO_DESCRIPTOR_REGISTRY[spec["id"]].from_spec(spec)
  
imports: from __future__ import annotations
  import typing
  from abc import ABC
  from abc import abstractmethod
  from functools import update_wrapper
  from ...exceptions import InvalidArgument
label_desc: Use image node_id 1 for calling a global function with example usage: from_spec(spec) and returns: IO_DESCRIPTOR_REGISTRY