python: Translate C examples into Python and include documentation.