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

# BTrees.IIBTree.multiunion

All Samples(76)  |  Call(56)  |  Derive(0)  |  Import(20)
```multiunion(seq) -- compute union of a sequence of integer sets.

Each element of seq must be an integer set, or convertible to one
via the set iteration protocol.  The union returned is an IISet.
```

```from BTrees.IIBTree import difference
from BTrees.IIBTree import intersection
from BTrees.IIBTree import multiunion
from BTrees.IOBTree import IOBTree
from BTrees.Length import Length
```
```            # Aggregate sets for each bucket separately, to avoid
# large-small union penalties.
until_only = multiunion(self._until_only.values(term))
since_only = multiunion(self._since_only.values(None, term))
until = multiunion(self._until.values(term))
```
```                until = intersection(resultset, until)

since = multiunion(self._since.values(None, term))
bounded = intersection(until, since)

```

```from datetime import datetime

from Acquisition import aq_inner, aq_parent
from BTrees.IIBTree import multiunion
from BTrees.IIBTree import intersection
```
```        #   XXX Does this apply for multiunion?
#
until_only = multiunion(self._until_only.values(term))
since_only = multiunion(self._since_only.values(None, term))
until = multiunion(self._until.values(term))
```
```            until = intersection(res, until)

since = multiunion(self._since.values(None, term))
bounded = intersection(until, since)
result = multiunion([bounded, until_only, since_only, self._always])
```

```from Products.PluginIndexes.common.util import parseIndexRequest
from Products.PluginIndexes.common import safe_callable
from BTrees.IIBTree import IISet, multiunion, difference, intersection, union
from BTrees.OIBTree import OIBTree
import BTrees
```
```
# start in inside range
start = multiunion(self._since_index.values(max=qstart))
end = multiunion(self._until_index.values(min=qstart))
start_into = intersection(start, end)

# end inside range
start = multiunion(self._since_index.values(max=qend))
end = multiunion(self._until_index.values(min=qend))
```

```from BTrees.IIBTree import IITreeSet
from BTrees.IIBTree import IISet
from BTrees.IIBTree import multiunion
from BTrees.IOBTree import IOBTree
from BTrees.Length import Length
```
```                s = IISet((s, ))
setlist.append(s)
return multiunion(setlist)

def _convert(self, value, default=None):
```
```                        s = IISet((s,))
tmp.append(s)
r = multiunion(tmp)
else:
# For intersection, sort with smallest data set first
```
```                    for s in setlist:
smalllist.append(intersection(resultset, s))
r = multiunion(smalllist)
else:
r = multiunion(setlist)
```

```from cgi import escape
from BTrees.IIBTree import union, multiunion
from BTrees.IIBTree import intersection
from Products.PluginIndexes.common.util import parseIndexRequest
from BTrees.IIBTree import IISet
```
```
if operator == 'or':
r = multiunion(setlist)
else:
# For intersection, sort with smallest data set first
```
```                for s in setlist:
smalllist.append(intersection(res, s))
r = multiunion(smalllist)
else:
r = multiunion(setlist)
```

```from BTrees.IIBTree import union, multiunion
from BTrees.IIBTree import intersection
from Products.PluginIndexes.common.util import parseIndexRequest
from BTrees.IIBTree import IISet

```
```        # Search at every level, return the union of all results
return multiunion(
[self.search(path, level, depth, navtree, navtree_start)
for level in xrange(self._depth + 1)])

```
```    if navtree and depth > 0:
# Include the elements up to the matching path
depthset = multiunion([
self._index.get(None, {}).get(i, IISet())
for i in range(min(navtree_start, level),
```
```        start = len(comps) - 1
if navtree: start = max(start, (navtree_start - level))
depthset = multiunion(filter(None, [depthset] + [
intersection(pathset, self._index.get(None, {}).get(i + level))
for i in xrange(start, start + depth + 1)]))
```

```
from DateTime import DateTime
from BTrees.IIBTree import IISet, IITreeSet, \
difference, union, multiunion, intersection
from BTrees.OOBTree import OOBTree
```
```    sqs= csq['lookup'] + csq['complex'] + csq['indexed'] + csq['notQ']
if not sqs: return IISet()
if len(sqs) >= 4: return multiunion([q._eval(context) for q in sqs])
r = None
for q in sqs: r = union(r,q._eval(context))
```

```import logging

from App.special_dtml import DTMLFile
from BTrees.IIBTree import IISet, IITreeSet, intersection, union, multiunion
from BTrees.OOBTree import OOBTree
```
```            # Search at every level, return the union of all results
return multiunion(
[self.search(path, level, depth, navtree, navtree_start)
for level in xrange(self._depth + 1)])

```
```        if navtree and depth > 0:
# Include the elements up to the matching path
depthset = multiunion([
self._index.get(None, {}).get(i, IISet())
for i in range(min(navtree_start, level),
```
```            if navtree:
start = max(start, (navtree_start - level))
depthset = multiunion(filter(None, [depthset] + [
intersection(pathset, self._index.get(None, {}).get(i + level))
for i in xrange(start, start + depth + 1)]))
```

```import persistent
from BTrees.IIBTree import IIBTree, IISet, IITreeSet
from BTrees.IIBTree import difference, intersection, multiunion
from BTrees.IOBTree import IOBTree
from BTrees.OIBTree import OIBTree
```
```            results.append((len(result), result))
results.sort() # optimization; merge smallest to largest
return multiunion([r[1] for r in results])

```
```            results.append((len(result), result))
results.sort() # optimization; merge smallest to largest
return multiunion([r[1] for r in results])

```
```            ancestor = ancestor and ancestor or '/'
rids.append(self.below(tmpl % ancestor))
rids = multiunion(rids)

```
```                    break
_rids.append(self.levels[i])
rids = intersection(rids, multiunion(_rids))

return rids
```

```from BTrees.IIBTree import union, multiunion
from BTrees.IIBTree import intersection
from Products.PluginIndexes.common.util import parseIndexRequest
from BTrees.IIBTree import IISet

```
```            #r = set_func(r, set)
# XXX: Use multiunion!
r = multiunion(setlist)

else: # not a range search
```

1 | 2 | 3  Next