Added documentation of global variables and example code

This example makes use of the updated global "dunder" variables
updated in #7121