code: def pubsub_sub(self, topic, discover=False, **kwargs):
          
          args = (topic, discover)
          return SubChannel(self._client.request('/pubsub/sub', args,
                            stream=True, decoder='json'))
docs: Subscribe to mesages on a given topic
  
          Subscribing to a topic in IPFS means anytime
          a message is published to a topic, the subscribers
          will be notified of the publication.
  
          The connection with the pubsub topic is opened and read.
          The Subscription returned should be used inside a context
          manager to ensure that it is closed properly and not left
          hanging.
  
          .. code-block:: python
  
              >>> sub = c.pubsub_sub('testing')
              >>> with c.pubsub_sub('testing') as sub:
              # publish a message 'hello' to the topic 'testing'
              ... c.pubsub_pub('testing', 'hello')
              ... for message in sub:
              ...     print(message)
              ...     # Stop reading the subscription after
              ...     # we receive one publication
              ...     break
              {'from': '<base64encoded IPFS id>',
               'data': 'aGVsbG8=',
               'topicIDs': ['testing']}
  
              # NOTE: in order to receive published data
              # you must already be subscribed to the topic at publication
              # time.
  
          Parameters
          ----------
          topic : str
              Name of a topic to subscribe to
  
          discover : bool
              Try to discover other peers subscibed to the same topic
              (defaults to False)
  
          Returns
          -------
              Generator wrapped in a context
              manager that maintains a connection
              stream to the given topic.