def unwrap(value):
if isinstance(value, Document):<EOL><INDENT>return value.to_dict()<EOL><DEDENT>elif isinstance(value, DocumentList):<EOL><INDENT>return value.to_list()<EOL><DEDENT>else:<EOL><INDENT>return value<EOL><DEDENT>
Unwraps the given Document or DocumentList as applicable.