Return an astroid.YieldFrom node as string.
353708
def visit_yieldfrom(self, node):
        
        yi_val = (" " + node.value.accept(self)) if node.value else ""
        expr = "yield from" + yi_val
        if node.parent.is_statement:
            return expr

        return "(%s)" % (expr,)
119809
def visit_DictComp(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        return f"{{{self.visit(node.key)}: {self.visit(node.value)} " \
               f"{' '.join(self.visit(gen) for gen in node.generators)}}}"
259464
def getText(node, recursive=False):
    """"""
    L = [u'']
    for n in node.childNodes:
        if n.nodeType in (node.TEXT_NODE, node.CDATA_SECTION_NODE):
            L.append(n.data)
        else:
            if not recursive:
                return None
        L.append(getText(n))
    return u''.join(L)
964220
def iter_equivalent_nodes(self, node: BaseEntity) -> Iterable[BaseEntity]:
        """"""
        yield node
        yield from self._equivalent_node_iterator_helper(node, {node})
949648
def generator(self, t):
        """"""
        return np.power(-np.log(t), self.theta)
81373
def nodes(self, node=None):
        ''''''
        if node is None:
            for root in self.stack:
                yield from self.nodes(root)
        else:
            yield node
            if node.is_container():
                for child in node.children:
                    yield from self.nodes(child)
859011
def get_module_all(node):
    
    all_ = None

    if "__all__" in node.locals:
        assigned = next(node.igetattr("__all__"))
        if assigned is not astroid.Uninferable:
            all_ = []
            for elt in getattr(assigned, "elts", ()):
                try:
                    elt_name = next(elt.infer())
                except astroid.InferenceError:
                    continue

                if elt_name is astroid.Uninferable:
                    continue

                if isinstance(elt_name, astroid.Const) and isinstance(
                    elt_name.value, _STRING_TYPES
                ):
                    all_.append(elt_name.value)

    return all_
801010
def make_axes():
    """"""

    @axisfn()
    def child(node):
        return node.childNodes

    @axisfn()
    def descendant(node):
        for child in node.childNodes:
            for node in descendant_or_self(child):
                yield node

    @axisfn()
    def parent(node):
        if node.parentNode is not None:
            yield node.parentNode

    @axisfn(reverse=True)
    def ancestor(node):
        while node.parentNode is not None:
            node = node.parentNode
            yield node

    @axisfn()
    def following_sibling(node):
        while node.nextSibling is not None:
            node = node.nextSibling
            yield node

    @axisfn(reverse=True)
    def preceding_sibling(node):
        while node.previousSibling is not None:
            node = node.previousSibling
            yield node

    @axisfn()
    def following(node):
        while node is not None:
            while node.nextSibling is not None:
                node = node.nextSibling
                for n in descendant_or_self(node):
                    yield n
            node = node.parentNode

    @axisfn(reverse=True)
    def preceding(node):
        while node is not None:
            while node.previousSibling is not None:
                node = node.previousSibling
                # Could be more efficient here.
                for n in reversed(list(descendant_or_self(node))):
                    yield n
            node = node.parentNode

    @axisfn(principal_node_type=xml.dom.Node.ATTRIBUTE_NODE)
    def attribute(node):
        if node.attributes is not None:
            return (node.attributes.item(i)
                    for i in xrange(node.attributes.length))
        return ()

    @axisfn()
    def namespace(node):
        raise XPathNotImplementedError("namespace axis is not implemented")

    @axisfn()
    def self(node):
        yield node

    @axisfn()
    def descendant_or_self(node):
        yield node
        for child in node.childNodes:
            for node in descendant_or_self(child):
                yield node

    @axisfn(reverse=True)
    def ancestor_or_self(node):
        return chain([node], ancestor(node))

    # Place each axis function defined here into the 'axes' dict.
    for axis in locals().values():
        axes[axis.__name__] = axis
658397
def path(self):
        """"""
        yield self
        if not self.parent: return
        for node in self.parent.path: yield node
137159
def _AtNonLeaf(self, attr_value, path):
    """"""
    try:
      if isinstance(attr_value, collections.Mapping):
        # If it's dictionary-like, treat the dict key as the attribute..
        sub_obj = attr_value.get(path[1])
        if len(path) > 2:
          # Expand any additional elements underneath the key.
          sub_obj = self.Expand(sub_obj, path[2:])
        if isinstance(sub_obj, string_types):
          # If it is a string, stop here
          yield sub_obj
        elif isinstance(sub_obj, collections.Mapping):
          # If the result is a dict, return each key/value pair as a new dict.
          for k, v in iteritems(sub_obj):
            yield {k: v}
        else:
          for value in sub_obj:
            yield value
      else:
        # If it's an iterable, we recurse on each value.
        for sub_obj in attr_value:
          for value in self.Expand(sub_obj, path[1:]):
            yield value
    except TypeError:  # This is then not iterable, we recurse with the value
      for value in self.Expand(attr_value, path[1:]):
        yield value
1082741
def to_cnf(self):
        """"""
        node = self.node.to_cnf()
        if node is self.node:
            return self
        else:
            return _expr(node)
990885
def powernodes_in(self, name) -> iter:
        """"""
        yield from (node for node in self.all_in(name) if self.is_powernode(node))
1369039
def to_nnf(self):
        """"""
        node = self.node.to_nnf()
        if node is self.node:
            return self
        else:
            return _expr(node)
1195768
def get(self, key, value):
        """"""
        for element in self.neoindex[key][value]:
            if self.indexClass == "vertex":
                yield Vertex(element)
            elif self.indexClass == "edge":
                yield Edge(element)
            else:
                raise TypeError(self.indexClass)
1081898
def string(v):
    """"""
    if nodesetp(v):
        if not v:
            return u''
        return string_value(v[0])
    elif numberp(v):
        if v == float('inf'):
            return u'Infinity'
        elif v == float('-inf'):
            return u'-Infinity'
        elif str(v) == 'nan':
            return u'NaN'
        elif int(v) == v and v <= 0xffffffff:
            v = int(v)
        return unicode(v)
    elif booleanp(v):
        return u'true' if v else u'false'
    return v
1170800
def visit_Str(self, node):
        
        self.result[node] = self.builder.NamedType(pytype_to_ctype(str))
510928
def string_value(node):
    """"""
    if (node.nodeType == node.DOCUMENT_NODE or
        node.nodeType == node.ELEMENT_NODE):
        s = u''
        for n in axes['descendant'](node):
            if n.nodeType == n.TEXT_NODE:
                s += n.data
        return s

    elif node.nodeType == node.ATTRIBUTE_NODE:
        return node.value

    elif (node.nodeType == node.PROCESSING_INSTRUCTION_NODE or
          node.nodeType == node.COMMENT_NODE or
          node.nodeType == node.TEXT_NODE):
        return node.data