MCPcopy Create free account
hub / github.com/SalesforceAIResearch/perfcodegen / run

Method run

src/sanitize.py:44–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

42 self.generic_visit(node)
43
44 def run(self):
45 self.root = ast.parse(self.code)
46 self.only_func = True
47 for statement in self.root.body:
48 if not isinstance(statement, ast.FunctionDef) and not isinstance(statement, ast.ClassDef):
49 self.only_func = False
50 break
51 self.visit(self.root)
52
53 if len(self.classes) > 0 and len(self.func_names) > 0:
54 self.all_func_in_class = True
55 for f in self.func_names:
56 if f.split("@")[-1] == "global":
57 self.all_func_in_class = False
58 break
59
60class PlaceHolder(ast.NodeTransformer):
61 def __init__(self):

Callers 3

runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected