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

All Samples(12)  |  Call(8)  |  Derive(0)  |  Import(4)
A string leaf

        def String(string, prefix=None):
    """A string leaf"""
    return Leaf(token.STRING, string, prefix=prefix)
        


src/p/y/py3kwarn-HEAD/py3kwarn2to3/fixes/fix_callable.py   py3kwarn(Download)
# Local imports
from py3kwarn2to3 import fixer_base
from py3kwarn2to3.fixer_util import Call, Name, String, Attr, touch_import
 
class FixCallable(fixer_base.BaseFix):
        touch_import(None, u'collections', node=node)
 
        args = [func.clone(), String(u', ')]
        args.extend(Attr(Name(u'collections'), Name(u'Callable')))
        return Call(Name(u'isinstance'), args, prefix=node.prefix)

src/p/y/py3kwarn-0.4.4/py3kwarn2to3/fixes/fix_callable.py   py3kwarn(Download)
# Local imports
from py3kwarn2to3 import fixer_base
from py3kwarn2to3.fixer_util import Call, Name, String, Attr, touch_import
 
class FixCallable(fixer_base.BaseFix):
        touch_import(None, u'collections', node=node)
 
        args = [func.clone(), String(u', ')]
        args.extend(Attr(Name(u'collections'), Name(u'Callable')))
        return Call(Name(u'isinstance'), args, prefix=node.prefix)

src/p/y/py3kwarn-HEAD/py3kwarn2to3/fixes/fix_operator.py   py3kwarn(Download)
 
from py3kwarn2to3 import fixer_base
from py3kwarn2to3.fixer_util import Call, Name, String, touch_import
 
 
    def _isCallable(self, node, results):
        obj = results["obj"]
        args = [obj.clone(), String(u", "), String(u"'__call__'")]
        return Call(Name(u"hasattr"), args, prefix=node.prefix)
 
    def _handle_type2abc(self, node, results, module, abc):
        touch_import(None, module, node)
        obj = results["obj"]
        args = [obj.clone(), String(u", " + u".".join([module, abc]))]
        return Call(Name(u"isinstance"), args, prefix=node.prefix)

src/p/y/py3kwarn-0.4.4/py3kwarn2to3/fixes/fix_operator.py   py3kwarn(Download)
 
from py3kwarn2to3 import fixer_base
from py3kwarn2to3.fixer_util import Call, Name, String, touch_import
 
 
    def _isCallable(self, node, results):
        obj = results["obj"]
        args = [obj.clone(), String(u", "), String(u"'__call__'")]
        return Call(Name(u"hasattr"), args, prefix=node.prefix)
 
    def _handle_type2abc(self, node, results, module, abc):
        touch_import(None, module, node)
        obj = results["obj"]
        args = [obj.clone(), String(u", " + u".".join([module, abc]))]
        return Call(Name(u"isinstance"), args, prefix=node.prefix)