Return the instance representing mapped input modules.

def from_modules(self, modules, no_dc=False, no_a=False,
                     record_defs=False, lax_yang_version=False, debug=0):
        """Return the instance representing mapped input modules."""
        self.namespaces = {
            "urn:ietf:params:xml:ns:netmod:dsdl-annotations:1" : "nma",
        }
        if not no_dc: self.namespaces[self.dc_uri] = "dc"
        if not no_a: self.namespaces[self.a_uri] = "a"
        self.global_defs = {}
        self.all_defs = {}
        self.identity_deps = {}
        self.identities = {}
        self.debug = debug
        self.module_prefixes = {}
        gpset = {}
        self.gg_level = 0
        metadata = []
        self.has_meta = False
        for module in modules[0].i_ctx.modules.values():
            yver = module.search_one("yang-version")
            if yver and float(yver.arg) > 1.0 and not lax_yang_version:
                raise error.EmitError(
                    "DSDL plugin supports only YANG version 1.")
            if module.keyword == "module":
                for idn in module.i_identities.values():
                    self.register_identity(idn)
        for module in modules:
            self.add_namespace(module)
            self.module = module
            annots = module.search(("ietf-yang-metadata", "annotation"))
            for ann in annots:
                aname = (self.module_prefixes[ann.main_module().arg] + ":" +
                         ann.arg)
                optel = SchemaNode("optional")
                atel = SchemaNode("attribute", optel).set_attr("name", aname)
                self.handle_substmts(ann, atel)
                metadata.append(optel)
        if metadata:
            self.has_meta = True
            metel = SchemaNode.define("__yang_metadata__")
            self.global_defs["__yang_metadata__"] = metel
            for mattr in metadata:
                metel.subnode(mattr)
        for module in modules:
            self.module = module
            self.prefix_stack = [self.module_prefixes[module.arg]]
            for aug in module.search("augment"):
                self.add_patch(gpset, aug)
            for sub in [ module.i_ctx.get_module(inc.arg)
                         for inc in module.search("include") ]:
                for aug in sub.search("augment"):
                    self.add_patch(gpset, aug)
        self.setup_top()
        for module in modules:
            self.module = module
            self.local_defs = {}
            if record_defs: self.preload_defs()
            self.prefix_stack = [self.module_prefixes[module.arg]]
            self.create_roots(module)
            self.lookup_expand(module, list(gpset.keys()))
            self.handle_substmts(module, self.data, gpset)
            for d in list(self.local_defs.values()):
                self.local_grammar.subnode(d)
            self.tree.subnode(self.local_grammar)
            self.all_defs.update(self.local_defs)
        self.all_defs.update(self.global_defs)
        self.dc_element(self.top_grammar, "date", time.strftime("%Y-%m-%d"))
        return self