<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def subscribe_topics(self):
 """subscribe to all registered device and node topics"""

        base = self.topic
        subscribe = self.mqtt.subscribe

        # device topics
        subscribe(b"/".join((base, b"$stats/interval/set")))
        subscribe(b"/".join((self.settings.MQTT_BASE_TOPIC, b"$broadcast/#")))

        # node topics
        nodes = self.nodes
        for node in nodes:
            for topic in node.subscribe:
                topic = b"/".join((base, topic))
                # print('MQTT SUBSCRIBE: {}'.format(topic))
                subscribe(topic)
                self.topic_callbacks[topic] = node.callback