Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(21)  |  Call(11)  |  Derive(0)  |  Import(10)
weightedIntersection(o1, o2 [, w1, w2]) -- compute the intersection of o1 and o2

w1 and w2 are weights.

src/p/r/Products.ZCTextIndex-2.13.5/src/Products/ZCTextIndex/SetOps.py   Products.ZCTextIndex(Download)
 
from BTrees.IIBTree import IIBucket
from BTrees.IIBTree import weightedIntersection
from BTrees.IIBTree import weightedUnion
 
    L.sort(lambda x, y: cmp(len(x[0]), len(y[0])))
    (x, wx), (y, wy) = L[:2]
    dummy, result = weightedIntersection(x, y, wx, wy)
    for x, wx in L[2:]:
        dummy, result = weightedIntersection(result, x, 1, wx)

src/p/r/Products.ZCatalog-3.0.2/src/Products/PluginIndexes/common/ResultList.py   Products.ZCatalog(Download)
from BTrees.IIBTree import difference
from BTrees.IIBTree import IIBucket
from BTrees.IIBTree import weightedIntersection
from BTrees.IIBTree import weightedUnion
from BTrees.OOBTree import OOSet
    def __and__(self, x):
        return self.__class__(
            weightedIntersection(self._dict, x._dict),
            union(self._words, x._words),
            self._index,

src/e/x/experimental.catalogqueryplan-3.2.8/experimental/catalogqueryplan/catalog.py   experimental.catalogqueryplan(Download)
from time import time
 
from BTrees.IIBTree import intersection, weightedIntersection
from BTrees.IIBTree import IIBucket, IIBTree, IISet
 
                r, u = r
                result_len = len(r)
                w, rs = weightedIntersection(rs, r)
            pri.append((isinstance(index, advancedtypes), result_len, i))
 
                    _i = '%s_weightedIntersection'%i
                    index_times[_i] = time()
                    w, rs = weightedIntersection(rs, r)
                    index_times[_i] = time() - index_times[_i]
                else:

src/p/r/Products.ZCatalog-3.0.2/src/Products/ZCatalog/Catalog.py   Products.ZCatalog(Download)
import BTrees.Length
from BTrees.IIBTree import intersection, IISet
from BTrees.IIBTree import weightedIntersection
from BTrees.OIBTree import OIBTree
from BTrees.IOBTree import IOBTree
                # we get, as some indexes don't return simple sets
                if hasattr(rs, 'items') or hasattr(r, 'items'):
                    _, rs = weightedIntersection(rs, r)
                else:
                    rs = intersection(rs, r)

src/e/e/eea.facetednavigation-6.7/eea/facetednavigation/widgets/widget.py   eea.facetednavigation(Download)
from zope.schema.interfaces import IVocabularyFactory
from zope.component import queryUtility
from BTrees.IIBTree import weightedIntersection, IISet
 
from Products.CMFCore.utils import getToolByName
            rset = ctool.apply_index(self.context, index, normalized_value)[0]
            rset = IISet(rset)
            rset = weightedIntersection(brains, rset)[1]
            if isinstance(value, unicode):
                res[value] = len(rset)

src/e/e/eea.facetednavigation-HEAD/eea/facetednavigation/widgets/widget.py   eea.facetednavigation(Download)
from zope.schema.interfaces import IVocabularyFactory
from zope.component import queryUtility
from BTrees.IIBTree import weightedIntersection, IISet
 
from Products.CMFCore.utils import getToolByName
            rset = ctool.apply_index(self.context, index, normalized_value)[0]
            rset = IISet(rset)
            rset = weightedIntersection(brains, rset)[1]
            if isinstance(value, unicode):
                res[value] = len(rset)

src/c/o/collective.catalogcache-0.2/collective/catalogcache/patch.py   collective.catalogcache(Download)
import BTrees.Length
from BTrees.IIBTree import intersection, weightedIntersection, IISet
from BTrees.OIBTree import OIBTree
from BTrees.IOBTree import IOBTree
from Products.ZCatalog.Lazy import LazyMap, LazyCat
            if r is not None:
                r, u = r
                w, rs = weightedIntersection(rs, r)
 
        search_indexes = self._get_search_indexes(request)

src/e/x/experimental.catalogqueryplan-3.2.8/experimental/catalogqueryplan/tests/test_plan.py   experimental.catalogqueryplan(Download)
 
from BTrees.IIBTree import intersection as iiintersection
from BTrees.IIBTree import weightedIntersection as iiweightedIntersection
from BTrees.IIBTree import difference as iidifference
from BTrees.IIBTree import IISet, IITreeSet, IIBTree, IIBucket
    def weightedIntersection(self, o1, o2, w1=1, w2=1):
        return iiweightedIntersection(o1, o2, w1, w2)
    from BTrees.IIBTree import weightedUnion, union
    from BTrees.IIBTree import IIBucket as mkbucket
    builders = IIBucket, IIBTree, testSetOps.itemsToSet(IISet), testSetOps.itemsToSet(IITreeSet)

src/e/x/experimental.btree-1.1/experimental/btree/tests/test_sets.py   experimental.btree(Download)
from experimental.btree import setpatches
setpatches.apply()
 
from BTrees.IIBTree import intersection as iiintersection
from BTrees.IIBTree import weightedIntersection as iiweightedIntersection
    def weightedIntersection(self, o1, o2, w1=1, w2=1):
        return iiweightedIntersection(o1, o2, w1, w2)
    from BTrees.IIBTree import weightedUnion, union
    from BTrees.IIBTree import IIBucket as mkbucket
    builders = IIBucket, IIBTree, testSetOps.itemsToSet(IISet), testSetOps.itemsToSet(IITreeSet)

src/b/t/BTrees-4.0.8/BTrees/tests/test_IIBTree.py   BTrees(Download)
    def weightedIntersection(self):
        from BTrees.IIBTree import weightedIntersection
        return weightedIntersection
 
    def union(self):