def qstat_error(qstat_stdout):
    """ Returns true if error state from qstat stdout, false otherwise
    """
    state = ""
    for line in qstat_stdout.split("\n"):
        if line.startswith("job_state"):
            # get job state
            _, state = line.split(":")
            state = state.strip()
            break  # exit for loop
    return "E" in state