original_docstring: 
      restart update and polloing processes.
      
docstring: restart update and polloing processes.
docstring_tokens: restart update and polloing processes .
code: def restart_procs():
      '''
      restart update and polloing processes.
      '''
      global update_proc, update_err_msg, polling_proc, polling_err_msg
  
      if update_proc and update_proc.poll() is None:
          # if running, kill it first
          sys.stderr.write('kill update proc {}\n'.format(update_proc.pid))
          update_proc.terminate()
      update_proc = subprocess.Popen(shlex.split(UPDATE_CMD),
                                     stdout=open('update.log', 'a', 1),
                                     stderr=subprocess.PIPE)
      sys.stderr.write('start update proc {}\n'.format(update_proc.pid))
      # reset the error messages
      update_err_msg = ''
  
      if polling_proc and polling_proc.poll() is None:
          # if running, kill it first
          sys.stderr.write('kill polling proc {}\n'.format(polling_proc.pid))
          polling_proc.terminate()
      polling_proc = subprocess.Popen(shlex.split(POLLING_CMD),
                                      stdout=open('polling.log', 'a', 1),
                                      stderr=subprocess.PIPE)
      sys.stderr.write('start polling proc {}\n'.format(polling_proc.pid))
      # reset the error messages
      polling_err_msg = ''
  
      time.sleep(1)
      # check if dead immediately and get error messages
      check_status()
code_tokens: def restart_procs ( ) : global update_proc , update_err_msg , polling_proc , polling_err_msg if update_proc and update_proc . poll ( ) is None : sys . stderr . write ( 'kill update proc {}\n' . format ( update_proc . pid ) ) update_proc . terminate ( ) update_proc = subprocess . Popen ( shlex . split ( UPDATE_CMD ) , stdout = open ( 'update.log' , 'a' , 1 ) , stderr = subprocess . PIPE ) sys . stderr . write ( 'start update proc {}\n' . format ( update_proc . pid ) ) update_err_msg = '' if polling_proc and polling_proc . poll ( ) is None : sys . stderr . write ( 'kill polling proc {}\n' . format ( polling_proc . pid ) ) polling_proc . terminate ( ) polling_proc = subprocess . Popen ( shlex . split ( POLLING_CMD ) , stdout = open ( 'polling.log' , 'a' , 1 ) , stderr = subprocess . PIPE ) sys . stderr . write ( 'start polling proc {}\n' . format ( polling_proc . pid ) ) polling_err_msg = '' time . sleep ( 1 ) check_status ( )
short_docstring: restart update and polloing processes.
short_docstring_tokens: restart update and polloing processes .
comment: '''
      restart update and polloing processes.
      '''$SEP$# if running, kill it first$SEP$# reset the error messages$SEP$# if running, kill it first$SEP$# reset the error messages$SEP$# check if dead immediately and get error messages