In step 1, we pull the necessary Python standard library and PyEZ framework definitions into the global namespace so that we can make use of them. Steps 2 through 5 are all very similar to what we’ve seen in previous recipes: setting error handlers, parsing command- line arguments, and opening the PyEZ Device() constructor respectively.
But of particular note, though, in step 1 is the reference to jnpr.junos.op.inventory.ModuleTable, which is, PyEZ-included class that represents a JUNOS device hardware module and is instantiated through a Python factory loader shim from a piece of YAML definition.