code: def _get_namespace2go2term(go2terms):
          
          namespace2go2term = cx.defaultdict(dict)
          for goid, goterm in go2terms.items():
              namespace2go2term[goterm.namespace][goid] = goterm
          return namespace2go2term
docs: Group GO IDs by namespace.