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

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

        def query_backends(path, backends, allowed_backend_names=None):
    if not backends:
        raise NoBackend()
    if allowed_backend_names is None:
        disallowed, allowed = [], backends
    else:
        disallowed, allowed = dichotomy(
            lambda b: b.name in allowed_backend_names, backends)
    results = _query_backends(path, allowed)
    ineligible, eligible = dichotomy(_is_eligible, results)
    if not eligible:
        raise NoEligibleBackend(
            path, ineligible, disallowed_backends=disallowed)
    # XXX: Can maybe get rid of this.
    eligible.sort(key=itemgetter('score'), reverse=True)
    return disallowed, ineligible, eligible
        


src/p/k/pkgme-0.4.3/pkgme/api.py   pkgme(Download)
 
from . import trace
from .backend import (
    choose_backend,
    get_default_loader,
    not guaranteed.
    """
    return query_backends(target_dir, backends)[2]
 
 
    """
    disallowed, ineligible, eligible = query_backends(
        path, backends, allowed_backend_names)
    backend = choose_backend(eligible)
    info = backend.get_info(path)

src/p/k/pkgme-0.4.3/pkgme/tests/test_backend.py   pkgme(Download)
    )
 
from ..backend import (
    Backend,
    BackendSelector,
    def test_eligible_backends_only(self):
        eligible = [self.make_backend(score=10), self.make_backend(score=20)]
        expected_eligible = self.to_query(eligible)
        result = query_backends('.', eligible)
        self.assertEqual(
        ineligible = [self.make_backend() for i in range(3)]
        expected_ineligible = self.to_query(ineligible)
        result = query_backends('.', eligible + ineligible)
        self.assertEqual(
            ([], expected_ineligible, expected_eligible),