<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def download_contents(self, to_folder=None):
 """ This will download each file and folder sequentially. Caution when downloading big folder structures :param drive.Folder to_folder: folder where to store the contents """

        to_folder = to_folder or Path()
        if not to_folder.exists():
            to_folder.mkdir()

        for item in self.get_items(query=self.new_query().select('id', 'size')):
            if item.is_folder and item.child_count > 0:
                item.download_contents(to_folder=to_folder / item.name)
            else:
                item.download(to_folder)