code: def stop_vm(self):
          
          if self.vagrant is not None:
              if self.destroy:
                  self.vagrant.destroy()
                  shutil.rmtree(self.vagrant.root, ignore_errors=True)
                  self.vagrant = None
              else:
                  self.vagrant.halt()
docs: Stops or destroys the VM used to launch tasks.