def matching_sets(path, type)
      @matched_set_cache ||= {}
      @matched_set_cache[path] ||= {}
      @matched_set_cache[path][type] ||= begin
        valid_sets.select do |set|
          !set.key?("scope") || applies?(set["scope"], path, type)
        end
      end
    end
def matching_sets(path, type)
      @matched_set_cache ||= {}
      @matched_set_cache[path] ||= {}
      @matched_set_cache[path][type] ||= begin
        valid_sets.select do |set|
          !set.key?("scope") || applies?(set["scope"], path, type)
        end
      end
    end
rubocop: enable PredicateName
 Collects a list of sets that match the given path and type

 Returns an array of hashes