code: def _nodes_to_regs(self):
          
          def get_tuples():
              for r, re_match in self._re_matches:
                  for group_name, group_index in r.groupindex.items():
                      if group_name != _INVALID_TRAILING_INPUT:
                          reg = re_match.regs[group_index]
                          node = self._group_names_to_nodes[group_name]
                          yield (node, reg)
  
          return list(get_tuples())
docs: Return a list of (varname, reg) tuples.