class_docstr: Vendored from starlette.MultipartParser.
  
  Thanks starlette!
  
  Made the following modifications
      - Use GradioUploadFile instead of UploadFile
      - Use NamedTemporaryFile instead of SpooledTemporaryFile
      - Compute hash of data as the request is streamed
class_docstr_tok: ["Vendored","from","starlette.MultipartParser",".","Thanks","starlette","!","Made","the","following","modifications","-","Use","GradioUploadFile","instead","of","UploadFile","-","Use","NamedTemporaryFile","instead","of","SpooledTemporaryFile","-","Compute","hash","of","data","as","the","request","is","streamed"]
code: def __init__(
      self,
      headers: Headers,
      stream: AsyncGenerator[bytes, None],
      *,
      max_files: Union[int, float] = 1000,
      max_fields: Union[int, float] = 1000,
      upload_id: str | None = None,
      upload_progress: FileUploadProgress | None = None,
  ) -> None:
      assert (
          multipart is not None
      ), "The `python-multipart` library must be installed to use form parsing."
      self.headers = headers
      self.stream = stream
      self.max_files = max_files
      self.max_fields = max_fields
      self.items: List[Tuple[str, Union[str, UploadFile]]] = []
      self.upload_id = upload_id
      self.upload_progress = upload_progress
      self._current_files = 0
      self._current_fields = 0
      self._current_partial_header_name: bytes = b""
      self._current_partial_header_value: bytes = b""
      self._current_part = MultipartPart()
      self._charset = ""
      self._file_parts_to_write: List[Tuple[MultipartPart, bytes]] = []
      self._file_parts_to_finish: List[MultipartPart] = []
      self._files_to_close_on_error: List[_TemporaryFileWrapper] = []
  
imports: from __future__ import annotations
  import hashlib
  import json
  from collections import deque
  from dataclasses import dataclass
  from tempfile import NamedTemporaryFile, _TemporaryFileWrapper
  from typing import TYPE_CHECKING, AsyncGenerator, BinaryIO, List, Optional, Tuple, Union
  import fastapi
  import httpx
  import multipart
  from gradio_client.documentation import document, set_documentation_group
  from multipart.multipart import parse_options_header
  from starlette.datastructures import FormData, Headers, UploadFile
  from starlette.formparsers import MultiPartException, MultipartPart
  from gradio import utils
  from gradio.data_classes import PredictBody
  from gradio.exceptions import Error
  from gradio.helpers import EventData
  from gradio.state_holder import SessionState
label_desc: Use image node_id 1 to create a new GradioMultiPartParser object  with example: obj = GradioMultiPartParser(headers, stream)