def find_funcdef(source):
try:<EOL><INDENT>module_node = compile(<EOL>source, "<STR_LIT>", mode="<STR_LIT>", flags=ast.PyCF_ONLY_AST<EOL>)<EOL><DEDENT>except SyntaxError:<EOL><INDENT>return find_funcdef(fix_lamdaline(source))<EOL><DEDENT>for node in ast.walk(module_node):<EOL><INDENT>if isinstance(node, ast.FunctionDef) or isinstance(node, ast.Lambda):<EOL><INDENT>return node<EOL><DEDENT><DEDENT>raise ValueError("<STR_LIT>")<EOL>
Find the first FuncDef ast object in source