code: def wrap(value):
      
      if isinstance(value, Document) or isinstance(value, DocumentList):
          return value
      elif isinstance(value, dict):
          return Document(value)
      elif isinstance(value, list):
          return DocumentList(value)
      else:
          return value
docs: Wraps the given value in a Document or DocumentList as applicable.