def download(self, module):
import_r = '<STR_LIT>'<EOL>include_r = '<STR_LIT>'<EOL>logger.debug('<STR_LIT>'.format(module))<EOL>try:<EOL><INDENT>from .device import ModelDevice<EOL>reply = super(ModelDevice, self.device).execute(operations.retrieve.GetSchema, module)<EOL><DEDENT>except operations.rpc.RPCError:<EOL><INDENT>logger.warning("<STR_LIT>".format(module))<EOL>return<EOL><DEDENT>if reply.ok:<EOL><INDENT>fname = self.dir_yang + '<STR_LIT:/>' + module + '<STR_LIT>'<EOL>with open(fname, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(reply.data)<EOL><DEDENT>self.downloaded.add(module)<EOL>imports = set()<EOL>includes = set()<EOL>for line in reply.data.splitlines():<EOL><INDENT>match = re.search(import_r, line)<EOL>if match:<EOL><INDENT>imports.add(match.group(<NUM_LIT:1>).strip())<EOL>continue<EOL><DEDENT>match = re.search(include_r, line)<EOL>if match:<EOL><INDENT>includes.add(match.group(<NUM_LIT:1>).strip())<EOL>continue<EOL><DEDENT><DEDENT>s = (imports | includes) - self.downloaded - self.to_be_downloaded<EOL>if s:<EOL><INDENT>logger.info('<STR_LIT>'.format(module, '<STR_LIT:U+002CU+0020>'.join(s)))<EOL>self.to_be_downloaded.update(s)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>logger.warning("<STR_LIT>".format(module, reply._raw))<EOL><DEDENT>
download

        High-level api: Download a module schema.

        Parameters
        ----------

        module : `str`
            Module name that will be downloaded.

        Returns
        -------

        None
            Nothing returns.