code: def last_revision(self, mod: YangIdentifier) -> ModuleId:
          
          revs = [mn for mn in self.modules if mn[0] == mod]
          if not revs:
              raise ModuleNotRegistered(mod)
          return sorted(revs, key=lambda x: x[1])[-1]
docs: Return the last revision of a module that's part of the data model.
  
          Args:
              mod: Name of a module or submodule.
  
          Raises:
              ModuleNotRegistered: If the module `mod` is not present in the
                  data model.