def load_model(self, model):
if os.path.isfile(model):<EOL><INDENT>file_name, file_ext = os.path.splitext(model)<EOL>if file_ext.lower() == '<STR_LIT>':<EOL><INDENT>logger.debug('<STR_LIT>'.format(model))<EOL>with open(model, '<STR_LIT:r>') as f:<EOL><INDENT>xml = f.read()<EOL><DEDENT>parser = etree.XMLParser(remove_blank_text=True)<EOL>tree = etree.XML(xml, parser)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>".format(model))<EOL><DEDENT><DEDENT>elif model in self.models_loadable:<EOL><INDENT>if self.compiler is None:<EOL><INDENT>raise ValueError('<STR_LIT>''<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>m = self.compiler.compile(model)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>""<STR_LIT>".format(model))<EOL><DEDENT>if m.name in self.models:<EOL><INDENT>self.nodes = {k: v for k, v in self.nodes.items()<EOL>if self.roots[k.split('<STR_LIT:U+0020>')[<NUM_LIT:0>]] != m.name}<EOL>logger.info('<STR_LIT>'.format(m.name))<EOL><DEDENT>else:<EOL><INDENT>logger.info('<STR_LIT>'.format(m.name))<EOL><DEDENT>self.models[m.name] = m<EOL>return m<EOL>
load_model

        High-level api: Load schema information by compiling the model using
        pyang package.

        Parameters
        ----------

        model : `str`
            Model name.

        Returns
        -------

        Model
            An instance of Model.


        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()
            >>>
            >>> m = device.nc.load_model('openconfig-system')
            >>> print(m)
            ...
            >>>