code: def __init__(
      self,
      api: "internal_api.Api",
      stats: "stats.Stats",
      event_queue: "queue.Queue[Event]",
      max_threads: int,
      file_stream: "file_stream.FileStreamApi",
      settings: Optional["SettingsStatic"] = None,
  ) -> None:
      self._api = api
      self._stats = stats
      self._event_queue = event_queue
      self._file_stream = file_stream
  
      self._thread = threading.Thread(target=self._thread_body)
      self._thread.daemon = True
  
      self._pool = concurrent.futures.ThreadPoolExecutor(
          thread_name_prefix="wandb-upload",
          max_workers=max_threads,
      )
  
      self._async_executor = (
          AsyncExecutor(
              pool=self._pool,
              concurrency_limit=settings._async_upload_concurrency_limit,
          )
          if settings is not None
          and settings._async_upload_concurrency_limit
          else None
      )
  
      # Indexed by files' `save_name`'s, which are their ID's in the Run.
      self._running_jobs: MutableMapping[
          LogicalPath, RequestUpload
      ] = {}
      self._pending_jobs: MutableSequence[RequestUpload] = []
  
      self._artifacts: MutableMapping[str, ArtifactStatus] = {}
  
      self.silent = bool(settings.silent) if settings else False
  
imports: import asyncio
  import concurrent.futures
  import logging
  import queue
  import sys
  import threading
  from typing import TYPE_CHECKING, Awaitable, Callable, MutableMapping, MutableSequence, MutableSet, NamedTuple, Optional, Union
  from wandb.errors.term import termerror
  from wandb.filesync import upload_job
  from wandb.sdk.lib.paths import LogicalPath
label_desc: Use image node_id 1 to create a new StepUpload object  with example: obj = StepUpload(api, stats, event_queue, max_threads, file_stream, settings)