code: def get_root_object(models):
      
      root = napalm_yang.base.Root()
  
      for model in models:
          current = napalm_yang
          for p in model.split("."):
              current = getattr(current, p)
          root.add_model(current)
  
      return root
docs: Read list of models and returns a Root object with the proper models added.