def find_all_include_defs(self) -> List[include_def.IncludeDef]: """ :return: all include_defs function calls. For example, for "include_defs("//foo/DEFS")" it will return [ IncludeDef( Call( func=Name(id='include_defs', ctx=Load()), args=[Str(s='//foo/DEFS')], keywords=[]) ) ) ] """ return [ include_def.from_ast_call(node) for node in ast.walk(self.ast_module) if isinstance(node, ast.Call) if isinstance(node.func, ast.Name) if node.func.id == "include_defs" ]
def _parse_include_def(self, code: str) -> include_def.IncludeDef: return include_def.from_ast_call(ast.parse(code).body[0].value)