I wonder how much worse or better simply automating a stackexchange search and pasting the results is...

Searching SO and converting the highest rated answer's code that doesn't syntax error to a Python module is about 150 LoC[0].

[0]: https://github.com/drathier/stack-overflow-import