code: def wait_for_notification(self, notification_class=BaseNotification):
          
          if notification_class:
              if notification_class is BaseNotification:
                  message = "No notification was shown."
              else:
                  message = "{0} was not shown.".format(notification_class.__name__)
              self.wait.until(
                  lambda _: isinstance(self.notification, notification_class),
                  message=message,
              )
              return self.notification
          else:
              self.wait.until(
                  lambda _: self.notification is None,
                  message="Unexpected notification shown.",
              )
docs: Wait for the specified notification to be displayed.
  
          Args:
              notification_class (:py:class:`BaseNotification`, optional):
                  The notification class to wait for. If `None` is specified it
                  will wait for any notification to be closed. Defaults to
                  `BaseNotification`.
  
          Returns:
              :py:class:`BaseNotification`: Firefox notification.