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
评论列表
文章目录