code: def test_dataclass_subtype():
      x = X(a=B())
  
      assert isinstance(x.a, B)
  
      x2 = serde.decode(serde.encode(x))
      assert isinstance(x2.a, B)
  
file_path: gluonts/test/core/test_serde_dataclass.py
imports: from typing import List
  from gluonts.core import serde
  from gluonts.pydantic import BaseModel
label_desc: Use image node_id 2 for calling a global function with example usage: test_dataclass_subtype() without return types