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

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Check that something isn't an attribute or function name etc.

        def is_probably_builtin(node):
    """
    Check that something isn't an attribute or function name etc.
    """
    prev = node.prev_sibling
    if prev is not None and prev.type == token.DOT:
        # Attribute lookup.
        return False
    parent = node.parent
    if parent.type in (syms.funcdef, syms.classdef):
        return False
    if parent.type == syms.expr_stmt and parent.children[0] is node:
        # Assignment.
        return False
    if parent.type == syms.parameters or \
            (parent.type == syms.typedargslist and (
            (prev is not None and prev.type == token.COMMA) or
            parent.children[0] is node
            )):
        # The name of an argument.
        return False
    return True
        


src/p/y/py3kwarn-HEAD/py3kwarn2to3/fixes/fix_long.py   py3kwarn(Download)
# Local imports
from py3kwarn2to3 import fixer_base
from py3kwarn2to3.fixer_util import find_binding, is_probably_builtin
 
 
    def transform(self, node, results):
        if self.skip:
            return
 
        if is_probably_builtin(node):

src/p/y/py3kwarn-0.4.4/py3kwarn2to3/fixes/fix_long.py   py3kwarn(Download)
# Local imports
from py3kwarn2to3 import fixer_base
from py3kwarn2to3.fixer_util import find_binding, is_probably_builtin
 
 
    def transform(self, node, results):
        if self.skip:
            return
 
        if is_probably_builtin(node):