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.
docstr: Clean up.
  
  Anything pushed after finish will be dropped.
  
  Arguments:
      exitcode: The exitcode of the watched process.
docstr_tok: ["Clean","up",".","Anything","pushed","after","finish","will","be","dropped",".","Arguments",":","exitcode",":","The","exitcode","of","the","watched","process","."]
code: def finish(self, exitcode: int) -> None:
      """Clean up.
  
      Anything pushed after finish will be dropped.
  
      Arguments:
          exitcode: The exitcode of the watched process.
      """
      logger.info("file stream finish called")
      self._queue.put(self.Finish(exitcode))
      # TODO(jhr): join on a thread which exited with an exception is a noop, clean up this path
      self._thread.join()
      logger.info("file stream finish is done")
      if self._exc_info:
          logger.error("FileStream exception", exc_info=self._exc_info)
          # re-raising the original exception, will get re-caught in internal.py for the sender thread
          if self._exc_info[1] is not None:
              raise self._exc_info[1].with_traceback(self._exc_info[2])
  
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 17 for calling the FileStreamApi obj's underlying member method code with example usage: obj.finish(exitcode) without return types