def download_all(self, check_before_download=True):
<EOL>if check_before_download:<EOL><INDENT>if not self.need_download:<EOL><INDENT>logger.info('<STR_LIT>''<STR_LIT>'.format(self.yang_capabilities))<EOL>return<EOL><DEDENT><DEDENT>for root, dirs, files in os.walk(self.dir_yang):<EOL><INDENT>for f in files:<EOL><INDENT>os.remove(os.path.join(root, f))<EOL><DEDENT><DEDENT>self.to_be_downloaded = set(self.device.models_loadable)<EOL>self.downloaded = set()<EOL>while self.to_be_downloaded:<EOL><INDENT>self.download(self.to_be_downloaded.pop())<EOL><DEDENT>with open(self.yang_capabilities, '<STR_LIT:w>') as f:<EOL><INDENT>f.write('<STR_LIT:\n>'.join(sorted(list(self.device.server_capabilities))))<EOL><DEDENT>
download_all

        High-level api: Convert cxml tree to an internal schema tree. This
        method is recursive.

        Parameters
        ----------

        check_before_download : `bool`
            True if checking capabilities.txt file is required.

        Returns
        -------

        None
            Nothing returns.