code: def __sub_add_reference(self, key):
          
          new_subs = self.__new_subs
          with new_subs:
              # don't allow multiple subscription requests to overwrite internal reference
              if key in new_subs:
                  raise ValueError('subscription for given args pending: %s' % str(key))
              new_subs[key] = None
          try:
              yield
          except:
              # don't preserve reference if request creation failed
              with new_subs:
                  new_subs.pop(key, None)
              raise
docs: Used by __sub_make_request to save reference for pending sub request