class_docstr: A wrapper for Qstat to avoid overloading the
  SGE/OGS server with rapid continuous qstat requests
class_docstr_tok: ["A","wrapper","for","Qstat","to","avoid","overloading","the","SGE\/OGS","server","with","rapid","continuous","qstat","requests"]
code: def _parse_qstat_job_list(self, xml_job_list):
      current_jobs_parsed = list()
      for current_job_element in xml_job_list:
          # jobname = current_job_element.getElementsByTagName('JB_name')[0].childNodes[0].data
          # jobown =
          # current_job_element.getElementsByTagName('JB_owner')[0].childNodes[0].data
          try:
              job_queue_name = (
                  current_job_element.getElementsByTagName(
                      "queue_name"
                  )[0]
                  .childNodes[0]
                  .data
              )
          except:
              job_queue_name = "unknown"
          try:
              job_slots = int(
                  current_job_element.getElementsByTagName("slots")[0]
                  .childNodes[0]
                  .data
              )
          except:
              job_slots = -1
          job_queue_state = current_job_element.getAttribute("state")
          job_num = int(
              current_job_element.getElementsByTagName("JB_job_number")[
                  0
              ]
              .childNodes[0]
              .data
          )
          try:
              job_time_text = (
                  current_job_element.getElementsByTagName(
                      "JAT_start_time"
                  )[0]
                  .childNodes[0]
                  .data
              )
              job_time = float(
                  time.mktime(
                      time.strptime(job_time_text, "%Y-%m-%dT%H:%M:%S")
                  )
              )
          except:
              job_time = float(0.0)
              # Make job entry
  
          task_id = int(job_num)
          if task_id in self._task_dictionary:
              self._task_dictionary[task_id].update_info(
                  job_queue_state, job_time, job_queue_name, job_slots
              )
              sge_debug_print(
                  f"Updating job:  {self._task_dictionary[task_id]}"
              )
              current_jobs_parsed.append(task_id)
              # Changed from job_num as "in" is used to check which does not cast
          else:
              # Any Job that was not explicitly added with qsub command is
              # out of scope
              self._out_of_scope_jobs.append(task_id)
  
      # To ensure that every job is in the dictionary has a state reported
      # by the SGE environment, it is necessary to explicitly check jobs
      # that are not reported by the qstat command to determine if they
      # were started and finished, and pushed out of the window of review
      # before their state being recorded.  The qacct command is slower, but
      # much more robust for ensuring that a job has completed.
      for dictionary_job in list(self._task_dictionary.keys()):
          if dictionary_job not in current_jobs_parsed:
              is_completed = self._qacct_verified_complete(
                  dictionary_job
              )
              if is_completed:
                  self._task_dictionary[dictionary_job].set_state(
                      "zombie"
                  )
              else:
                  sge_debug_print(
                      "ERROR:  Job not in current parselist, "
                      "and not in done list {}: {}".format(
                          dictionary_job,
                          self._task_dictionary[dictionary_job],
                      )
                  )
                  pass
          if self._task_dictionary[dictionary_job].is_initializing():
              is_completed = self._qacct_verified_complete(
                  dictionary_job
              )
              if is_completed:
                  self._task_dictionary[dictionary_job].set_state(
                      "zombie"
                  )
              else:
                  sge_debug_print(
                      "ERROR:  Job not in still in initialization mode, "
                      "and not in done list {}: {}".format(
                          dictionary_job,
                          self._task_dictionary[dictionary_job],
                      )
                  )
                  pass
  
imports: import os
  import pwd
  import re
  import subprocess
  import time
  import xml.dom.minidom
  import random
  from ...None import logging
  from ...interfaces.base import CommandLine
  from .base import SGELikeBatchManagerBase, logger
label_desc: Use image node_id 5 for calling the QstatSubstitute obj's underlying member method code with example usage: obj._parse_qstat_job_list(xml_job_list) without return types