The only new import we have in this example is for the Paho-MQTT client:
import paho.mqtt.client as mqtt # (1)
At line (1), we are importing the Paho-MQTT client class and giving it the alias, mqtt. As mentioned previously, this is the client class that will allow us to create a full life cycle MQTT client in Python.
Next, we will consider global variables.