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

All Samples(17)  |  Call(7)  |  Derive(0)  |  Import(10)
recursively generate nodes inferred by the given statement.
If the inferred value is a list or a tuple, recurse on the elements

        def unpack_infer(stmt, context=None):
    """recursively generate nodes inferred by the given statement.
    If the inferred value is a list or a tuple, recurse on the elements
    """
    if isinstance(stmt, (List, Tuple)):
        for elt in stmt.elts:
            for infered_elt in unpack_infer(elt, context):
                yield infered_elt
        return
    # if infered is a final node, return it and stop
    infered = stmt.infer(context).next()
    if infered is stmt:
        yield infered
        return
    # else, infer recursivly, except YES object that should be returned as is
    for infered in stmt.infer(context):
        if infered is YES:
            yield infered
        else:
            for inf_inf in unpack_infer(infered, context):
                yield inf_inf
        


src/p/y/pylama_pylint-0.1.6/pylama_pylint/astroid/scoped_nodes.py   pylama_pylint(Download)
from astroid.exceptions import NotFoundError, \
     AstroidBuildingException, InferenceError
from astroid.node_classes import Const, DelName, DelAttr, \
     Dict, From, List, Pass, Raise, Return, Tuple, Yield, \
     LookupMixIn, const_factory as cf, unpack_infer
        found = set()
        missing = False
        for iface in unpack_infer(implements):
            if iface is YES:
                missing = True

src/p/y/pylama_pylint-0.1.6/astroid/scoped_nodes.py   pylama_pylint(Download)
from astroid.exceptions import NotFoundError, \
     AstroidBuildingException, InferenceError
from astroid.node_classes import Const, DelName, DelAttr, \
     Dict, From, List, Pass, Raise, Return, Tuple, Yield, \
     LookupMixIn, const_factory as cf, unpack_infer
        found = set()
        missing = False
        for iface in unpack_infer(implements):
            if iface is YES:
                missing = True

src/a/s/astroid-1.1.1/scoped_nodes.py   astroid(Download)
from astroid.exceptions import NotFoundError, \
     AstroidBuildingException, InferenceError
from astroid.node_classes import Const, DelName, DelAttr, \
     Dict, From, List, Pass, Raise, Return, Tuple, Yield, YieldFrom, \
     LookupMixIn, const_factory as cf, unpack_infer
        found = set()
        missing = False
        for iface in unpack_infer(implements):
            if iface is YES:
                missing = True

src/p/y/pylama_pylint-0.1.6/pylama_pylint/astroid/protocols.py   pylama_pylint(Download)
 
from astroid.exceptions import InferenceError, NoDefault
from astroid.node_classes import unpack_infer
from astroid.bases import copy_context, \
     raise_if_nothing_infered, yes_if_nothing_infered, Instance, YES
def excepthandler_assigned_stmts(self, node, context=None, asspath=None):
    for assigned in unpack_infer(self.type):
        if isinstance(assigned, nodes.Class):
            assigned = Instance(assigned)
        yield assigned

src/p/y/pylama_pylint-0.1.6/astroid/protocols.py   pylama_pylint(Download)
 
from astroid.exceptions import InferenceError, NoDefault
from astroid.node_classes import unpack_infer
from astroid.bases import copy_context, \
     raise_if_nothing_infered, yes_if_nothing_infered, Instance, YES
def excepthandler_assigned_stmts(self, node, context=None, asspath=None):
    for assigned in unpack_infer(self.type):
        if isinstance(assigned, nodes.Class):
            assigned = Instance(assigned)
        yield assigned

src/a/s/astroid-1.1.1/protocols.py   astroid(Download)
 
from astroid.exceptions import InferenceError, NoDefault
from astroid.node_classes import unpack_infer
from astroid.bases import copy_context, \
     raise_if_nothing_infered, yes_if_nothing_infered, Instance, YES
def excepthandler_assigned_stmts(self, node, context=None, asspath=None):
    for assigned in unpack_infer(self.type):
        if isinstance(assigned, nodes.Class):
            assigned = Instance(assigned)
        yield assigned

src/p/y/pylama_pylint-0.1.6/pylama_pylint/astroid/__init__.py   pylama_pylint(Download)
from astroid import raw_building
from astroid.bases import YES, Instance, BoundMethod, UnboundMethod
from astroid.node_classes import are_exclusive, unpack_infer
from astroid.scoped_nodes import builtin_lookup
 

src/p/y/pylama_pylint-0.1.6/astroid/__init__.py   pylama_pylint(Download)
from astroid import raw_building
from astroid.bases import YES, Instance, BoundMethod, UnboundMethod
from astroid.node_classes import are_exclusive, unpack_infer
from astroid.scoped_nodes import builtin_lookup
 

src/a/s/astroid-1.1.1/__init__.py   astroid(Download)
from astroid import raw_building
from astroid.bases import YES, Instance, BoundMethod, UnboundMethod
from astroid.node_classes import are_exclusive, unpack_infer
from astroid.scoped_nodes import builtin_lookup
 

src/a/s/astroid-1.1.1/test/unittest_nodes.py   astroid(Download)
 
from logilab.common import testlib
from astroid.node_classes import unpack_infer
from astroid.bases import BUILTINS, YES, InferenceContext
from astroid.exceptions import AstroidBuildingException, NotFoundError
        handler_type = astroid.body[1].handlers[0].type
 
        excs = list(unpack_infer(handler_type))
 
    def test_absolute_import(self):