class_docstr: Pushes chunks of files to our streaming endpoint.
  
  This class is used as a singleton. It has a thread that serializes access to
  the streaming endpoint and performs rate-limiting and batching.
  
  TODO: Differentiate between binary/text encoding.
code: def __init__(
      self,
      api: "internal_api.Api",
      run_id: str,
      start_time: float,
      timeout: float = 0,
      settings: Optional[dict] = None,
  ) -> None:
      settings = settings or dict()
      # NOTE: exc_info is set in thread_except_body context and readable by calling threads
      self._exc_info: Optional[
          Union[
              Tuple[Type[BaseException], BaseException, TracebackType],
              Tuple[None, None, None],
          ]
      ] = None
      self._settings = settings
      self._api = api
      self._run_id = run_id
      self._start_time = start_time
      self._client = requests.Session()
      timeout = timeout or 0
      if timeout > 0:
          self._client.post = functools.partial(self._client.post, timeout=timeout)  # type: ignore[method-assign]
      self._client.auth = api.client.transport.session.auth
      self._client.headers.update(api.client.transport.headers or {})
      self._client.cookies.update(api.client.transport.cookies or {})  # type: ignore[no-untyped-call]
      self._client.proxies.update(
          api.client.transport.session.proxies or {}
      )
      self._file_policies: Dict[str, DefaultFilePolicy] = {}
      self._dropped_chunks: int = 0
      self._queue: queue.Queue = queue.Queue()
      self._thread = threading.Thread(target=self._thread_except_body)
      # It seems we need to make this a daemon thread to get sync.py's atexit handler to run, which
      # cleans this thread up.
      self._thread.name = "FileStreamThread"
      self._thread.daemon = True
      self._init_endpoint()
  
imports: import base64
  import functools
  import itertools
  import logging
  import os
  import queue
  import random
  import sys
  import threading
  import time
  from types import TracebackType
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, NamedTuple, Optional, Set, Tuple, Type, Union
  import requests
  import wandb
  from wandb import util
  from wandb.sdk.internal import internal_api
  from ..lib import file_stream_utils
label_desc: Use image node_id 1 to create a new FileStreamApi object  with example: obj = FileStreamApi(api, run_id, start_time, timeout, settings)