code: def check_log(logfile, exited='Exited with exit code',
                successful='Successfully completed', exists=True):
      
      if not os.path.exists(logfile):
          return not exists
  
      if exited in open(logfile).read():
          return 'Exited'
      elif successful in open(logfile).read():
          return 'Successful'
      else:
          return 'None'
docs: Often logfile doesn't exist because the job hasn't begun
      to run. It is unclear what you want to do in that case...
  
      Parameters
      ----------
      logfile : str
          String with path to logfile
      exists  : bool
          Is the logfile required to exist
      exited  : str
          String in logfile used to determine if a job exited.
      successful : str
          String in logfile used to determine if a job succeeded.