class_docstr: Reuses PrestoEngineSpec functionality.
class_docstr_tok: ["Reuses","PrestoEngineSpec","functionality","."]
code: def progress(cls, log_lines: list[str]) -> int:
      total_jobs = 1  # assuming there's at least 1 job
      current_job = 1
      stages: dict[int, float] = {}
      for line in log_lines:
          match = cls.jobs_stats_r.match(line)
          if match:
              total_jobs = int(match.groupdict()["max_jobs"]) or 1
          match = cls.launching_job_r.match(line)
          if match:
              current_job = int(match.groupdict()["job_number"])
              total_jobs = int(match.groupdict()["max_jobs"]) or 1
              stages = {}
          match = cls.stage_progress_r.match(line)
          if match:
              stage_number = int(match.groupdict()["stage_number"])
              map_progress = int(match.groupdict()["map_progress"])
              reduce_progress = int(
                  match.groupdict()["reduce_progress"]
              )
              stages[stage_number] = (
                  map_progress + reduce_progress
              ) / 2
      logger.info(
          "Progress detail: %s, current job %s, total jobs: %s",
          stages,
          current_job,
          total_jobs,
      )
  
      stage_progress = (
          sum(stages.values()) / len(stages.values()) if stages else 0
      )
  
      progress = (
          100 * (current_job - 1) / total_jobs
          + stage_progress / total_jobs
      )
      return int(progress)
  
imports: from __future__ import annotations
  import logging
  import os
  import re
  import tempfile
  import time
  from datetime import datetime
  from typing import Any, TYPE_CHECKING
  from urllib import parse
  import numpy
  import pandas
  import pyarrow
  import pyarrow.parquet
  from flask import current_app, g
  from sqlalchemy import Column, text, types
  from sqlalchemy.engine.base import Engine
  from sqlalchemy.engine.reflection import Inspector
  from sqlalchemy.engine.url import URL
  from sqlalchemy.sql.expression import ColumnClause, Select
  from superset import db
  from superset.common.db_query_status import QueryStatus
  from superset.constants import TimeGrain
  from superset.databases.utils import make_url_safe
  from superset.db_engine_specs.base import BaseEngineSpec
  from superset.db_engine_specs.presto import PrestoEngineSpec
  from superset.exceptions import SupersetException
  from superset.extensions import cache_manager
  from superset.models.sql_lab import Query
  from superset.sql_parse import ParsedQuery, Table
  from superset.superset_typing import ResultSetColumnType
label_desc: Use image node_id 8 for calling the HiveEngineSpec obj's underlying member method code with example usage: obj.progress(cls, log_lines) and returns: int