Yield solvers that fullfil the requirements.
965314
def filter_solvers(solvers, requirements):
    """"""
    for solver in solvers:
        for req, value in iteritems(requirements):
            if (req in ('integer', 'quadratic', 'rational', 'name') and
                    (req not in solver or solver[req] != value)):
                break
        else:
            yield solver
928987
def p_Yield(p):
    '''
    
    '''
    if len(p) == 2:
        p[0] = Yield(None, None)
    elif len(p) == 3:
        p[0] = Yield(p[2], None)
    else:
        p[0] = Yield(p[2], p[4])
911118
def conditions(self):
        """"""
        for idx in six.moves.range(1, len(self.children), 2):
            yield (self.children[idx - 1], self.children[idx])
436356
def missing_requirements(self, specifiers):
        
        for specifier in specifiers:
            try:
                pkg_resources.require(specifier)
            except pkg_resources.DistributionNotFound:
                yield specifier
1189845
def run_reaction_production_check(self, model, solver, threshold,
                                      implicit_sinks=True):
        """"""
        prob = solver.create_problem()

        # Create flux variables
        v = prob.namespace()
        for reaction_id in model.reactions:
            lower, upper = model.limits[reaction_id]
            v.define([reaction_id], lower=lower, upper=upper)

        # Build mass balance constraints
        massbalance_lhs = {compound: 0 for compound in model.compounds}
        for spec, value in iteritems(model.matrix):
            compound, reaction_id = spec
            massbalance_lhs[compound] += v(reaction_id) * value

        # Create production variables and apply constraints
        for compound, lhs in iteritems(massbalance_lhs):
            if implicit_sinks:
                # The constraint is merely >0 meaning that we have implicit
                # sinks for all compounds.
                prob.add_linear_constraints(lhs >= 0)
            else:
                prob.add_linear_constraints(lhs == 0)

        confirmed_production = set()
        for reaction in model.reactions:
            if all(c in confirmed_production for c, _ in
                   model.get_reaction_values(reaction)):
                continue

            prob.set_objective(v(reaction))
            for sense in (lp.ObjectiveSense.Maximize,
                          lp.ObjectiveSense.Minimize):
                try:
                    result = prob.solve(sense)
                except lp.SolverError as e:
                    self.fail(
                        'Failed to solve for compound, reaction: {}, {}:'
                        ' {}'.format(compound, reaction, e))

                flux = result.get_value(v(reaction))
                for compound, value in model.get_reaction_values(reaction):
                    if compound in confirmed_production:
                        continue

                    production = 0
                    if sense == lp.ObjectiveSense.Maximize and flux > 0:
                        production = float(value) * flux
                    elif sense == lp.ObjectiveSense.Minimize and flux < 0:
                        production = float(value) * flux

                    if production >= threshold:
                        confirmed_production.add(compound)

        for compound in sorted(model.compounds):
            if compound not in confirmed_production:
                yield compound
124284
def gen_all(self):
        """"""

        borderfuncs = [
            self.get_b, self.get_r, self.get_t, self.get_l,
            self.get_tl, self.get_tr, self.get_rt, self.get_rb,
            self.get_br, self.get_bl, self.get_lb, self.get_lt,
        ]

        for borderfunc in borderfuncs:
            yield borderfunc()
380492
def solve_ifelse(expr, vars):
    """"""
    for condition, result in expr.conditions():
        if boolean.asbool(solve(condition, vars).value):
            return solve(result, vars)

    return solve(expr.default(), vars)
943758
def _yield_estimators(model):
    
    yield from _yield_preproc_steps(model)

    net_prefixes = []
    module_prefixes = []

    if isinstance(model, Pipeline):
        name = model.steps[-1][0]
        net_prefixes.append(name)
        module_prefixes.append(name)
        net = model.steps[-1][1]
    else:
        net = model

    yield '__'.join(net_prefixes), net

    module = net.module
    module_prefixes.append('module')
    yield '__'.join(module_prefixes), module
104263
def all_generators(self):
        
        for arg_gen in self.arg_gens:
            yield arg_gen

        for kwarg_gen in self.kwarg_gens.values():
            yield kwarg_gen
989057
def fold_enrichment(self):
        """"""
        return self.k / (self.K*(self.cutoff/float(self.N)))
870100
def iter_terms(fs, conj=False):
    
    for num in range(1 << len(fs)):
        yield num2term(num, fs, conj)
125203
def _all_valid(links):
    """"""
    for k, v in links.items():
        for i in v:
            yield k, i
306189
def iflatten(L):
    """"""
    for sublist in L:
        if hasattr(sublist, '__iter__'):
            for item in iflatten(sublist): yield item
        else: yield sublist
147469
def modules(self):
        """"""

        resource = self.RMODULES

        params = {
            self.PLIMIT: self.max_items,
            self.PSORT_BY: self.VLATEST_RELEASE
        }

        for page in self._fetch(resource, params):
            yield page
839336
def parse(self, generator):
        """"""
        gen = iter(generator)
        for line in gen:
            block = {}
            for rule in self.rules:
                if rule[0](line):
                    block = rule[1](line, gen)
                    break
            yield block
1015754
def generate_chunks(data, chunk_size=DEFAULT_CHUNK_SIZE):
    """"""
    iterator = iter(repeated.getvalues(data))

    while True:
        chunk = list(itertools.islice(iterator, chunk_size))
        if not chunk:
            return

        yield chunk
709567
def frange(start, end, step):
    """"""
    if start <= end:
        step = abs(step)
    else:
        step = -abs(step)

    while start < end:
        yield start
        start += step