The first example:
$ from idpyoidc.client import RPHandler
should be
$ from idpyoidc.client.rp_handler import RPHandler
The function get_access_token() is not present in RPHandler class.
There is no info for which version of idpy-oidc this documentation was written.