def stop(self):
        """Stops the spinner and clears the line.
        Returns
        -------
        self
        """
        if self._spinner_thread and self._spinner_thread.is_alive():
            self._stop_spinner.set()
            self._spinner_thread.join()

        if self.enabled:
            self.clear()

        self._frame_index = 0
        self._spinner_id = None
        self._show_cursor()
        return self
Stops the spinner and clears the line.
        Returns
        -------
        self
        
halo/halo.py