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

# BTrees.IIBTree.weightedUnion

All Samples(8)  |  Call(3)  |  Derive(0)  |  Import(5)
```weightedUnion(o1, o2 [, w1, w2]) -- compute the union of o1 and o2

w1 and w2 are weights.
```

```from BTrees.IIBTree import IIBucket
from BTrees.IIBTree import weightedIntersection
from BTrees.IIBTree import weightedUnion

from Products.ZCTextIndex.NBest import NBest
```
```        (x, wx), dummy = merge.pop_smallest()
(y, wy), dummy = merge.pop_smallest()
dummy, z = weightedUnion(x, y, wx, wy)
(result, weight), dummy = merge.pop_smallest()
```
```    [(result, weight)] = L
if weight != 1:
dummy, result = weightedUnion(IIBucket(), result, 0, weight)
return result

```

```from BTrees.IIBTree import IIBucket
from BTrees.IIBTree import weightedIntersection
from BTrees.IIBTree import weightedUnion
from BTrees.OOBTree import OOSet
from BTrees.OOBTree import union
```
```    def __or__(self, x):
return self.__class__(
weightedUnion(self._dict, x._dict),
union(self._words, x._words),
self._index,
```

```    def weightedUnion(self):
from BTrees.IIBTree import weightedUnion
return weightedUnion

def weightedIntersection(self):
```

```    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)
```

```    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)
```