astTools.py 文件源码

python
阅读 42 收藏 0 点赞 0 评论 0

项目:ITAP-django 作者: krivers 项目源码 文件源码
def gatherAllHelpers(a, restricted_names):
    """Gather all helper function names in the tree that have been anonymized"""
    if type(a) != ast.Module:
        return set()
    helpers = set()
    for item in a.body:
        if type(item) == ast.FunctionDef:
            if not hasattr(item, "dontChangeName") and item.name not in restricted_names: # this got anonymized
                origName = item.originalId if hasattr(item, "originalId") else None
                helpers |= set([(item.name, origName)])
    return helpers
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号