code: def subscribe(self, subscriber: 'Subscriber',
                    prepend: bool = False) -> SubscriptionDisposable:
          
  
          # `subscriber in self._subscriptions` is not working because
          # tuple.__contains__ is using __eq__ which is overwritten and returns
          # a new publisher - not helpful here
          if any(subscriber is s for s in self._subscriptions):
              raise SubscriptionError('Subscriber already registered')
  
          if prepend:
              self._subscriptions.insert(0, subscriber)
          else:
              self._subscriptions.append(subscriber)
  
          return SubscriptionDisposable(self, subscriber)
docs: Subscribing the given subscriber.
  
          :param subscriber: subscriber to add
          :param prepend: For internal use - usually the subscribers will be
              added at the end of a list. When prepend is True, it will be added
              in front of the list. This will habe an effect in the order the
              subscribers are called.
          :raises SubscriptionError: if subscriber already subscribed