code: def kill_speech_dispatcher(self):
          '''kill speech dispatcher processs'''
          if not 'HOME' in os.environ:
              return
          pidpath = os.path.join(os.environ['HOME'], '.speech-dispatcher',
                                 'pid', 'speech-dispatcher.pid')
          if os.path.exists(pidpath):
              try:
                  import signal
                  pid = int(open(pidpath).read())
                  if pid > 1 and os.kill(pid, 0) is None:
                      print("Killing speech dispatcher pid %u" % pid)
                      os.kill(pid, signal.SIGINT)
                      time.sleep(1)
              except Exception as e:
                  pasf kill_speech_dispatcher(self):
          '''kill speech dispatcher processs'''
          if not 'HOME' in os.environ:
              return
          pidpath = os.path.join(os.environ['HOME'], '.speech-dispatcher',
                                 'pid', 'speech-dispatcher.pid')
          if os.path.exists(pidpath):
              try:
                  import signal
                  pid = int(open(pidpath).read())
                  if pid > 1 and os.kill(pid, 0) is None:
                      print("Killing speech dispatcher pid %u" % pid)
                      os.kill(pid, signal.SIGINT)
                      time.sleep(1)
              except Exception as e:
                  pass
docs: kill speech dispatcher processs