code: def register_callback(self, key):
          
          if self.pending_callbacks is None:
              # Lazily initialize the old-style YieldPoint data structures.
              self.pending_callbacks = set()
              self.results = {}
          if key in self.pending_callbacks:
              raise KeyReuseError("key %r is already pending" % (key,))
          self.pending_callbacks.add(key)
docs: Adds ``key`` to the list of callbacks.