def has_nested_definitions(function): return has_nodes(function.tree.body, (ast.FunctionDef, ast.ClassDef, ast.Lambda))