code: def prt_hier_up(self, goids, prt=sys.stdout):
          
          go2goterm_all = {go:self.gosubdag.go2obj[go] for go in goids}
          objp = GoPaths()
          items_list = []
          for namespace, go2term_ns in self._get_namespace2go2term(go2goterm_all).items():
              goids_all = set()  # GO IDs from user-specfied GO to root
              for goid_usr, goterm in go2term_ns.items():
                  goids_all.add(goid_usr)
                  paths = objp.get_paths_from_to(goterm, goid_end=None, dn0_up1=True)
                  goids_all.update(set(o.id for p in paths for o in p))
              # Only include GO IDs from user-specified GO to the root
              if 'include_only' not in self.usrdct:
                  self.usrdct['include_only'] = set()
              self.usrdct['include_only'].update(goids_all)
              # Mark the user-specfied GO term
              if 'item_marks' not in self.usrdct:
                  self.usrdct['item_marks'] = {}
              for goid_usr in go2term_ns.keys():
                  if goid_usr not in self.usrdct['item_marks']:
                      self.usrdct['item_marks'][goid_usr] = '*'
              # Write the hierarchy
              wrhiercfg = self._get_wrhiercfg()
              obj = WrHierPrt(self.gosubdag.go2obj, self.gosubdag.go2nt, wrhiercfg, prt)
              go_root = self._get_goroot(goids_all, namespace)
              obj.prt_hier_rec(go_root)
              items_list.extend(obj.items_list)
          return items_list
docs: Write hierarchy for all GO IDs below GO ID in arg, goid.