code: def set_thread(self, thread = None):
          
          if thread is None:
              self.__thread = None
          else:
              self.__load_Thread_class()
              if not isinstance(thread, Thread):
                  msg  = "Parent thread must be a Thread instance, "
                  msg += "got %s instead" % type(thread)
                  raise TypeError(msg)
              self.dwThreadId = thread.get_tid()
              self.__thread = thread
docs: Manually set the thread process. Use with care!
  
          @type  thread: L{Thread}
          @param thread: (Optional) Thread object. Use C{None} to autodetect.