code: def apply_augments(self, auglist, p_elem, pset):
          
          for a in auglist:
              par = a.parent
              if a.search_one("when") is None:
                  wel = p_elem
              else:
                  if p_elem.interleave:
                      kw = "interleave"
                  else:
                      kw = "group"
                  wel = SchemaNode(kw, p_elem, interleave=p_elem.interleave)
                  wel.occur = p_elem.occur
              if par.keyword == "uses":
                  self.handle_substmts(a, wel, pset)
                  continue
              if par.keyword == "submodule":
                  mnam = par.i_including_modulename
              else:
                  mnam = par.arg
              if self.prefix_stack[-1] == self.module_prefixes[mnam]:
                  self.handle_substmts(a, wel, pset)
              else:
                  self.prefix_stack.append(self.module_prefixes[mnam])
                  self.handle_substmts(a, wel, pset)
                  self.prefix_stack.pop()
docs: Handle substatements of augments from `auglist`.
  
          The augments are applied in the context of `p_elem`.  `pset`
          is a patch set containing patches that may be applicable to
          descendants.