code: def pre_disconnect(self, sid, namespace):
          
          if namespace not in self.pending_disconnect:
              self.pending_disconnect[namespace] = []
          self.pending_disconnect[namespace].append(sid)
docs: Put the client in the to-be-disconnected list.
  
          This allows the client data structures to be present while the
          disconnect handler is invoked, but still recognize the fact that the
          client is soon going away.