scan_models

        High-level api: Download models from the device by <get-schema>
        operation defined in RFC6022, and analyze dependencies among models
        using pyang package.

        Parameters
        ----------

        folder : `str`
            A path to a folder that stores YANG files downloaded.

        download : `str`
            A string is either `check` or `force`. If it is `check`, the content
            in the folder is compared with self.server_capabilities. Downloading
            will be skipped if the checking says good. If it is `force`,
            downloading starts without checking.

        Returns
        -------

        None
            Nothing returns.


        YAML Example::

            devices:
                asr22:
                    type: 'ASR'
                    tacacs:
                        login_prompt: "login:"
                        password_prompt: "Password:"
                        username: "admin"
                    passwords:
                        tacacs: admin
                        enable: admin
                        line: admin
                    connections:
                        a:
                            protocol: telnet
                            ip: "1.2.3.4"
                            port: 2004
                        vty:
                            protocol : telnet
                            ip : "2.3.4.5"
                        netconf:
                            class: yang.ncdiff.ModelDevice
                            ip : "2.3.4.5"
                            port: 830
                            username: admin
                            password: admin

        Code Example::

            >>> from pyats.topology import loader
            >>> testbed = loader.load('/users/yuekyang/projects/asr21.yaml')
            >>> device = testbed.devices['asr21']
            >>> device.connect(alias='nc', via='netconf')
            >>>
            >>> device.nc.scan_models()
            ...
            >>>

def scan_models(self, folder='./yang', download='check'):
        '''scan_models

        High-level api: Download models from the device by <get-schema>
        operation defined in RFC6022, and analyze dependencies among models
        using pyang package.

        Parameters
        ----------

        folder : `str`
            A path to a folder that stores YANG files downloaded.

        download : `str`
            A string is either `check` or `force`. If it is `check`, the content
            in the folder is compared with self.server_capabilities. Downloading
            will be skipped if the checking says good. If it is `force`,
            downloading starts without checking.

        Returns
        -------

        None
            Nothing returns.


        YAML Example::

            devices:
                asr22:
                    type: 'ASR'
                    tacacs:
                        login_prompt: "login:"
                        password_prompt: "Password:"
                        username: "admin"
                    passwords:
                        tacacs: admin
                        enable: admin
                        line: admin
                    connections:
                        a:
                            protocol: telnet
                            ip: "1.2.3.4"
                            port: 2004
                        vty:
                            protocol : telnet
                            ip : "2.3.4.5"
                        netconf:
                            class: yang.ncdiff.ModelDevice
                            ip : "2.3.4.5"
                            port: 830
                            username: admin
                            password: admin

        Code Example::

            >>> from pyats.topology import loader
            >>> testbed = loader.load('/users/yuekyang/projects/asr21.yaml')
            >>> device = testbed.devices['asr21']
            >>> device.connect(alias='nc', via='netconf')
            >>>
            >>> device.nc.scan_models()
            ...
            >>>
        '''

        d = ModelDownloader(self, folder)
        if download == 'force':
            d.download_all(check_before_download=False)
        elif download == 'check':
            d.download_all(check_before_download=True)
        self.compiler = ModelCompiler(folder)