Pattern: ^[ \t]*def\ [_a-z][_a-z0-9]*\([^\n]*\):\n ([ \t]*)[^\n]*\n
(?:(?:\1[^\n]*\n)|[ \t]*\n)*
Flags: I, M, X
The pattern is pretty busy to look at, but it was easy enough to
write. You can keep the configuration window open while you
experiment with a new pattern, so it's easy to see what does or
doesn't work. Just click Add and Apply each time you edit it.
Pattern: ^((\#?)[ \t]*)def\ +[_a-z][_a-z0-9]*\ *\([^:]*\):\n (\1
([ \t]*)).*\n (?: (?:\3.*\n) | [ \t]*\n | (?:\3.*$) )*
Flags: I, M, X