def METHOD_NAME(self, codes: set):
    for code, term in self.lookup_names(codes).items():
        match = term_and_type_pat.match(term)
        term_and_type = match.groups() if match else (term, "unknown")
        yield code, term_and_type