code: def get_matching_gos(self, compiled_pattern, **kws):
          
          # kws: prt gos
          matching_gos = []
          obo_dag = self.obo_dag
          prt = kws['prt'] if 'prt' in kws else self.log
          prt.write('\nPATTERN SEARCH: "{P}"\n'.format(P=compiled_pattern.pattern))
          # Only look through GOs in annotation or user-specified GOs
          srchgos = kws['gos'] if 'gos' in kws else self.go2items.keys()
          for go_id in srchgos:
              go_obj = obo_dag.get(go_id, None)
              if go_obj is not None:
                  for hdr in self.goa_srch_hdrs:
                      if hdr in go_obj.__dict__:
                          fld_val = getattr(go_obj, hdr)
                          matches = self._search_vals(compiled_pattern, fld_val)
                          for mtch in matches:
                              prt.write("MATCH {go_id}({NAME}) {FLD}: {M}\n".format(
                                  FLD=hdr, go_id=go_obj.id, NAME=go_obj.name, M=mtch))
                          if matches:
                              matching_gos.append(go_id)
              else:
                  prt.write("**WARNING: {GO} found in annotation is not found in obo\n".format(
                      GO=go_id))
          matching_gos = set(matching_gos)
          # Print summary message
          self._summary_matching_gos(prt, compiled_pattern.pattern, matching_gos, srchgos)
          return matching_gos
docs: Return all GOs which match the user regex pattern.