code: def search_shell(self):
          
          with self._lock:
              if self._shell is not None:
                  # A shell is already there
                  return
  
              reference = self._context.get_service_reference(SERVICE_SHELL)
              if reference is not None:
                  self.set_shell(reference)
docs: Looks for a shell service