Did I find the right examples for you? yes no

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

        def interleave(seqs, pass_exceptions=()):
    iters = it.imap(iter, seqs)
    while iters:
        newiters = []
        for itr in iters:
            try:
                yield next(itr)
                newiters.append(itr)
            except (StopIteration,) + tuple(pass_exceptions):
                pass
        iters = newiters
        


src/l/o/logic-0.1.10/logpy/core.py   logic(Download)
import itertools as it
from util import transitive_get as walk
from util import deep_transitive_get as walkstar
from util import (assoc, unique, dicthash, interleave, take, evalt,
        groupby, index)
    def allgoal(s):
        g = goaleval(reify(goals[0], s))
        return unique(interleave(
                        goaleval(reify((lall,) + tuple(goals[1:]), ss))(ss)
                        for ss in g(s)),
                except EarlyGoalError:
                    pass
        return unique(interleave(f(reifiedgoals), [EarlyGoalError]),
                      key=dicthash)
    return anygoal

src/l/o/logpy-HEAD/logpy/core.py   logpy(Download)
import itertools as it
from functools import partial
from .util import transitive_get as walk
from .util import deep_transitive_get as walkstar
from .util import (dicthash, interleave, take, evalt, index, multihash, unique)
    def allgoal(s):
        g = goaleval(reify(goals[0], s))
        return unique(interleave(
                        goaleval(reify((lall,) + tuple(goals[1:]), ss))(ss)
                        for ss in g(s)),
                continue
            other_goals = tuple(goals[:i] + goals[i+1:])
            return unique(interleave(goaleval(
                reify((lallfirst,) + other_goals, ss))(ss)
                for ss in goal(s)), key=dicthash)
                    pass
 
        return unique(interleave(f(local_goals), [EarlyGoalError]),
                      key=dicthash)
    anygoal.goals = goals