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

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)

src/p/r/Products.AdvancedQuery-3.0.3/Products/AdvancedQuery/ranking.py   Products.AdvancedQuery(Download)
from BTrees.IIBTree import difference
 
from AdvancedQuery import _BaseQuery, LiteralResultSet, And, intersection
from sorting import Sorter
from eval import _eval
    def generate(seq, vqs, mv):
      if not vqs: yield 0, seq; return
      vqs = vqs[:] # avoid side effects
      v,q = vqs.pop(); mv -= v
      q = And(LiteralResultSet(seq), q)
    for i in xrange(len(vqs)-1,-1,-1):
      v,q = vqs[i]
      q = And(LiteralResultSet(seq), q)
      qr = _eval(q, cat)
      if qr: yield v, qr; seq = difference(seq, qr)

src/p/r/Products.AdvancedQuery-3.0.3/Products/AdvancedQuery/__init__.py   Products.AdvancedQuery(Download)
except ImportError: from Globals import InitializeClass
 
from AdvancedQuery import Eq, In, Le, Ge, \
     MatchGlob, MatchRegexp, \
     Between, Not, And, Or, Generic, Indexed, \
def _makeAdvancedQuery(self,catalogSearchSpec):
  '''advanced query corresponding to *catalogSearchSpec* (a dictionary).'''
  q = And(); get = catalogSearchSpec.get
  for i in self.Indexes.objectIds():
    vi = get(i)