Fix and format examples

- remove imports that are not needed
- remove spaces at the end of lines
- convert tabs to spaces
- fix indentation
- always use pythonic style for line continuation
- fix broken misc/*py files