def _filterQueryResults(self, queryList, searchSpecs, troveLists,
                            queryOptions):
        newTroveLists = []
        for (query, queueId), troveList in itertools.izip(queryList,
                                                          troveLists):
            filterFn = query.getFilter()
            if filterFn is not None:
                newTroveList = filterFn(troveList)
            else:
                newTroveList = troveList
            if queryOptions.exactFlavors:
                flavorQuery = query.troveSpec[2]
                if flavorQuery is None:
                    flavorQuery = deps.parseFlavor('')
                newTroveList2 = [ x for x in newTroveList
                                  if flavorQuery == x[2] ]
                errorList = [ x[2] for x in newTroveList
                              if x not in newTroveList2 ]
                newTroveList = newTroveList2
            newTroveLists.append(newTroveList)
        if queryOptions.requireLatest:
            savedTroveLists = newTroveLists[:]
        flavorQueries = [ x[2] for x in searchSpecs ]
        bestFlavor = queryOptions.bestFlavor
        getLeaves = queryOptions.getLeaves
        troveTypes = queryOptions.troveTypes
        results, errorList = queryOptions.troveSource.filterByFlavors(
                                           flavorQueries,
                                           newTroveLists,
                                           getLeaves=getLeaves,
                                           bestFlavor=bestFlavor,
                                           troveTypes=troveTypes)
        if queryOptions.requireLatest:
            latestRequired = []
            for origRes, newRes in itertools.izip(savedTroveLists, results):
                # empty newRes is a TroveNotFound. we can ignore it for
                # requireLatest tests
                if newRes and (origRes != newRes):
                    maxVersion = max(x[1] for x in origRes)
                    if maxVersion != max(x[1] for x in newRes):
                        trvName = newRes[0][0]
                        flavors = sorted([x[2] for x in origRes \
                                if x[1] == maxVersion])
                        latestRequired.append((newRes[0], flavors, maxVersion))
            if latestRequired:
                raise errors.LatestRequired(latestRequired)
        return results, errorList
Filters results by version string or other filtering
dataset/ETHPy150Open sassoftware/conary/conary/repository/findtrove.py/TroveFinder._filterQueryResults