code: def from_spec(cls, spec: dict[str, t.Any]) -> t.Self:
      return cls(**spec)
  
file_path: BentoML/tests/unit/_internal/io/test_base.py
imports: from __future__ import annotations
  import typing
  from typing import TYPE_CHECKING
  import pytest
  from bentoml.io import IODescriptor
label_desc: Use image node_id 8 for calling the DummyDescriptor obj's underlying member method code with example usage: obj.from_spec(cls, spec) and returns: cls