original_docstring: 
              subscribes a listener to the passed URL
  
              Parameters:
                  url: string
                      shortened url to the path
                  callback: function
                      a function called upon each event
  
          
docstring: subscribes a listener to the passed URL
docstring_tokens: subscribes a listener to the passed URL
code: def subscribe(self, url, callback):
          """
              subscribes a listener to the passed URL
  
              Parameters:
                  url: string
                      shortened url to the path
                  callback: function
                      a function called upon each event
  
          """
          if self.listener is not None and self.listener.isAlive():
              self.listener.stop()
  
          endpoint = self._build_endpoint_url(url)
          self.event.set()
  
          try:
              assert isinstance(self.session, Authenticator)
              listener = FirebaseListener(endpoint, callback, event=self.event,
                                          token=self.session.idToken, logger=self.logger)
              if self.logger is not None:
                  marker = "?auth="
                  index = endpoint.find(marker)
                  shorturl = endpoint[0:index]
                  self.logger.info("Registered listener @ {}".format(shorturl))
              self.session.listener = listener
              return listener
          except AssertionError:
              listener = FirebaseListener(endpoint, callback, event=self.event, logger=self.logger)
              self.logger.info("Registered listener @ {}".format(listener.url))
              return listener
code_tokens: def subscribe ( self , url , callback ) : if self . listener is not None and self . listener . isAlive ( ) : self . listener . stop ( ) endpoint = self . _build_endpoint_url ( url ) self . event . set ( ) try : assert isinstance ( self . session , Authenticator ) listener = FirebaseListener ( endpoint , callback , event = self . event , token = self . session . idToken , logger = self . logger ) if self . logger is not None : marker = "?auth=" index = endpoint . find ( marker ) shorturl = endpoint [ 0 : index ] self . logger . info ( "Registered listener @ {}" . format ( shorturl ) ) self . session . listener = listener return listener except AssertionError : listener = FirebaseListener ( endpoint , callback , event = self . event , logger = self . logger ) self . logger . info ( "Registered listener @ {}" . format ( listener . url ) ) return listener
short_docstring: subscribes a listener to the passed URL
short_docstring_tokens: subscribes a listener to the passed URL
comment: """
              subscribes a listener to the passed URL
  
              Parameters:
                  url: string
                      shortened url to the path
                  callback: function
                      a function called upon each event
  
          """