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 _send(
      self, chunks: List[Chunk], uploaded: Optional[Set[str]] = None
  ) -> bool:
      uploaded_list = list(uploaded or [])
      # create files dict. dict of <filename: chunks> pairs where chunks are a list of
      # [chunk_id, chunk_data] tuples (as lists since this will be json).
      files = {}
      # Groupby needs group keys to be consecutive, so sort first.
      chunks.sort(key=lambda c: c.filename)
      for filename, file_chunks in itertools.groupby(
          chunks, lambda c: c.filename
      ):
          file_chunks_list = list(
              file_chunks
          )  # groupby returns iterator
          # Specific file policies are set by internal/sender.py
          self.set_default_file_policy(filename, DefaultFilePolicy())
          files[filename] = self._file_policies[
              filename
          ].process_chunks(file_chunks_list)
          if not files[filename]:
              del files[filename]
  
      for fs in file_stream_utils.split_files(
          files, max_bytes=util.MAX_LINE_BYTES
      ):
          self._handle_response(
              request_with_retry(
                  self._client.post,
                  self._endpoint,
                  json={"files": fs, "dropped": self._dropped_chunks},
                  retry_callback=self._api.retry_callback,
              )
          )
  
      if uploaded_list:
          if isinstance(
              request_with_retry(
                  self._client.post,
                  self._endpoint,
                  json={
                      "complete": False,
                      "failed": False,
                      "dropped": self._dropped_chunks,
                      "uploaded": uploaded_list,
                  },
              ),
              Exception,
          ):
              return False
      return True
  
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 12 for calling the FileStreamApi obj's underlying member method code with example usage: obj._send(chunks, uploaded) and returns: True, False