class_docstr: Shipper reads structured logs from logq and ships them to the determined-master.
  
  It will send a message on doneq when it finishes.
code: def _run(self) -> None:
      eofs = 0
      while eofs < 2:
          logs: List[Dict[str, Any]] = []
          deadline = time.time() + SHIPPER_FLUSH_INTERVAL
          # Pop logs until both collectors close, or we fill up a batch, or we hit the deadline.
          while eofs < 2 and len(logs) < LOG_BATCH_MAX_SIZE:
              now = time.time()
              timeout = deadline - now
              if timeout <= 0:
                  # We are already passed the deadline.
                  break
  
              try:
                  log = self.logq.get(timeout=timeout)
              except queue.Empty:
                  # We hit the timeout.
                  break
  
              if log is None:
                  eofs += 1
                  continue
  
              logs.append(log)
  
          if not logs:
              continue
  
          data = json.dumps({"logs": logs}).encode("utf8")
  
          # Try to ship for about ten minutes.
          backoffs = [
              0,
              1,
              5,
              10,
              15,
              15,
              15,
              15,
              15,
              15,
              15,
              60,
              60,
              60,
              60,
              60,
              60,
              60,
              60,
              60,
          ]
  
          self.ship(data, backoffs)
  
imports: import datetime
  import io
  import json
  import logging
  import os
  import queue
  import re
  import signal
  import socket
  import ssl
  import subprocess
  import sys
  import threading
  import time
  import traceback
  import urllib.error
  import urllib.request
  from typing import Any, Dict, Iterator, List, NamedTuple, Optional, cast
label_desc: Use image node_id 3 for calling the Shipper obj's underlying member method code with example usage: obj._run() without return types