class_docstr: A wrapper to start a python script with timeout.
  
  To test the actual models even without GPUs we simply start them and
  test whether they survive a certain amount of time "timeout". This allows to
  test if all imports are correct and the computation graph can be built without
  run the entire model on the CPU.
  
  Attributes:
      cmd (str): command to execute the example with all flags (including python)
      p: process handle
      timeout (int): timeout in seconds
class_docstr_tok: ["A","wrapper","to","start","a","python","script","with","timeout",".","To","test","the","actual","models","even","without","GPUs","we","simply","start","them","and","test","whether","they","survive","a","certain","amount","of","time","``","timeout","''",".","This","allows","to","test","if","all","imports","are","correct","and","the","computation","graph","can","be","built","without","run","the","entire","model","on","the","CPU",".","Attributes",":","cmd","(","str",")",":","command","to","execute","the","example","with","all","flags","(","including","python",")","p",":","process","handle","timeout","(","int",")",":","timeout","in","seconds"]
docstr: Execute python script in other process.
  
  Raises:
      SurviveException: contains the error message of the script if it terminated before timeout
docstr_tok: ["Execute","python","script","in","other","process",".","Raises",":","SurviveException",":","contains","the","error","message","of","the","script","if","it","terminated","before","timeout"]
code: def execute(self):
      """Execute python script in other process.
  
      Raises:
          SurviveException: contains the error message of the script if it terminated before timeout
      """
      self.start()
      self.join(self.timeout)
  
      if self.is_alive():
          self.p.terminate()
          self.p.kill()  # kill -9
          self.join()
      else:
          # something unexpected happend here, this script was supposed to survive at least the timeout
          if len(self.err) > 0:
              output = "STDOUT: \n\n\n" + self.out.decode("utf-8")
              output += "\n\n\n STDERR: \n\n\n" + self.err.decode(
                  "utf-8"
              )
              raise AssertionError(output)
  
file_path: tensorpack/tests/case_script.py
imports: from abc import abstractproperty
  import unittest
  import subprocess
  import shlex
  import sys
  import threading
  import os
  import shutil
label_desc: Use image node_id 3 for calling the PythonScript obj's underlying member method code with example usage: obj.execute() without return types