<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def unwrap(value):
 """ Unwraps the given Document or DocumentList as applicable. """

    if isinstance(value, Document):
        return value.to_dict()
    elif isinstance(value, DocumentList):
        return value.to_list()
    else:
        return value