def METHOD_NAME(self, recommends, resources):
    results = []
    rec_query = jmespath.compile('content.operationGroups[].operations[].resource')
    for r in recommends:
        rids = rec_query.search(r)
        for rid in list(rids):
            # some resource operations are about creating new resources, ie snapshot disk
            # before delete, remove those to focus on extant resources.
            if "$" in rid:
                rids.remove(rid)
        matched = list(self.match_ids(rids, resources))
        for m in matched:
            m.setdefault(self.annotation_key, []).append(r)
        results.extend(matched)
    return results