@classmethod<EOL><INDENT>def generate(<EOL>cls: Type[T], data: Generic, name: str = None, *, recursive: bool = True<EOL>) -> T:<DEDENT>
if name is None:<EOL><INDENT>name = cls.__name__<EOL><DEDENT>kls = make_class(name, {k: ib(default=None) for k in data}, bases=(cls,))<EOL>data = {<EOL>k: (<EOL>cls.generate(v, k.title())<EOL>if recursive and isinstance(v, Mapping)<EOL>else v<EOL>)<EOL>for k, v in data.items()<EOL>}<EOL>return kls(**data)<EOL>
Build dataclasses and objects from dictionaries, recursively.