code: def scan(self):
          
          has_threads = True
          try:
              try:
  
                  # Try using the Toolhelp API
                  # to scan for processes and threads.
                  self.scan_processes_and_threads()
  
              except Exception:
  
                  # On error, try using the PSAPI to scan for process IDs only.
                  self.scan_processes_fast()
  
                  # Now try using the Toolhelp again to get the threads.
                  for aProcess in self.__processDict.values():
                      if aProcess._get_thread_ids():
                          try:
                              aProcess.scan_threads()
                          except WindowsError:
                              has_threads = False
  
          finally:
  
              # Try using the Remote Desktop API to scan for processes only.
              # This will update the filenames when it's not possible
              # to obtain them from the Toolhelp API.
              self.scan_processes()
  
          # When finished scanning for processes, try modules too.
          has_modules = self.scan_modules()
  
          # Try updating the process filenames when possible.
          has_full_names = self.scan_process_filenames()
  
          # Return the completion status.
          return has_threads and has_modules and has_full_names
docs: Populates the snapshot with running processes and threads,
          and loaded modules.
  
          Tipically this is the first method called after instantiating a
          L{System} object, as it makes a best effort approach to gathering
          information on running processes.
  
          @rtype: bool
          @return: C{True} if the snapshot is complete, C{False} if the debugger
              doesn't have permission to scan some processes. In either case, the
              snapshot is complete for all processes the debugger has access to.