docs: def convert_job(row: list) -> dict:
      """Convert sacct row to dict."""
      state = row[-2]
      start_time_raw = row[-4]
      end_time_raw = row[-3]
      if state not in ('PENDING', 'CANCELLED'):
          start_time = datetime.strptime(start_time_raw, '%Y-%m-%dT%H:%M:%S')
          if state != 'RUNNING':
              end_time = datetime.strptime(end_time_raw, '%Y-%m-%dT%H:%M:%S')
          else:
              end_time = None
      else:
          start_time = end_time = None
  
      # parse name of job
      job_name = row[1]
      step_name, step_context = job_name.rstrip('_BOTH').rstrip('_SV').rsplit('_', 1)
  
      return {
          'id': int(row[0]),
          'name': job_name,
          'step': step_name,
          'context': step_context,
          'state': state,
          'start': start_time,
          'end': end_time,
          'elapsed': time_to_sec(row[-5]),
          'cpu': time_to_sec(row[-6]),
          'is_completed': state == 'COMPLETED',
      }