def unserialize(wd: WordDictionary, text: Dict):
if not isinstance(text, Mapping):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>t = text['<STR_LIT:type>']<EOL>if t == '<STR_LIT:string>':<EOL><INDENT>return text['<STR_LIT:value>']<EOL><DEDENT>elif t == '<STR_LIT>':<EOL><INDENT>if not isinstance(text['<STR_LIT>'], Mapping):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>for param in text['<STR_LIT>']:<EOL><INDENT>if not isinstance(param, str):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>return StringToTranslate(<EOL>wd=wd,<EOL>key=text['<STR_LIT:key>'],<EOL>count=text['<STR_LIT:count>'],<EOL>params=text['<STR_LIT>'],<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(t))<EOL><DEDENT><DEDENT>except KeyError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>
Transforms back a serialized value of `serialize()`