parameters: (self, event, subscriber, append=True)
docstring: Add a subscriber for an event.
  
          :param event: The name of an event.
          :param subscriber: The subscriber to be added (and called when the
                             event is published).
          :param append: Whether to append or prepend the subscriber to an
                         existing subscriber list for the event.
docstring_summary: Add a subscriber for an event.
docstring_tokens: Add a subscriber for an event .
function: def add(self, event, subscriber, append=True):
          """
          Add a subscriber for an event.
  
          :param event: The name of an event.
          :param subscriber: The subscriber to be added (and called when the
                             event is published).
          :param append: Whether to append or prepend the subscriber to an
                         existing subscriber list for the event.
          """
          subs = self._subscribers
          if event not in subs:
              subs[event] = deque([subscriber])
          else:
              sq = subs[event]
              if append:
                  sq.append(subscriber)
              else:
                  sq.appendleft(subscriber)
function_tokens: def add ( self , event , subscriber , append = True ) : subs = self . _subscribers if event not in subs : subs [ event ] = deque ( [ subscriber ] ) else : sq = subs [ event ] if append : sq . append ( subscriber ) else : sq . appendleft ( subscriber )