get_function_as_str
| Name | Type | Default | Description |
|---|---|---|---|
func_or_method | tp.Callable | -- | The function from which to extract the source code body. |
| Type | Description |
|---|---|
str | The source code of the function body, with function name, docstrings, and comments removed. Each line is stripped of leading/trailing whitespace, and empty lines are excluded. |
| Type | Description |
|---|---|
OSError | If the source code of the function cannot be retrieved (e.g., for built-in functions). |
SyntaxError | If the function’s source code cannot be parsed into an AST. |

