In Python language, I want to get AST for each method in my source code file.
I know that I can use the ast module.
But I only figured out to get AST at the file level. By this I mean I can easily call ast.parse() where the argument is a string contains the entire source code.
I want to give ast.parse() an input that is the string just for one method.
Is there any way I can grab the strings of method from the original string of the file?
My naive idea is to use "def" to split?