class_docstr: A Gradio request object that can be used to access the request headers, cookies,
  query parameters and other information about the request from within the prediction
  function. The class is a thin wrapper around the fastapi.Request class. Attributes
  of this class include: `headers`, `client`, `query_params`, and `path_params`. If
  auth is enabled, the `username` attribute can be used to get the logged in user.
  Example:
      import gradio as gr
      def echo(text, request: gr.Request):
          if request:
              print("Request headers dictionary:", request.headers)
              print("IP address:", request.client.host)
              print("Query parameters:", dict(request.query_params))
          return text
      io = gr.Interface(echo, "textbox", "textbox").launch()
  Demos: request_ip_headers
class_docstr_tok: ["A","Gradio","request","object","that","can","be","used","to","access","the","request","headers",",","cookies",",","query","parameters","and","other","information","about","the","request","from","within","the","prediction","function",".","The","class","is","a","thin","wrapper","around","the","fastapi.Request","class",".","Attributes","of","this","class","include",":","`","headers","`",",","`","client","`",",","`","query_params","`",",","and","`","path_params","`",".","If","auth","is","enabled",",","the","`","username","`","attribute","can","be","used","to","get","the","logged","in","user",".","Example",":","import","gradio","as","gr","def","echo","(","text",",","request",":","gr.Request",")",":","if","request",":","print","(","``","Request","headers","dictionary",":","''",",","request.headers",")","print","(","``","IP","address",":","''",",","request.client.host",")","print","(","``","Query","parameters",":","''",",","dict","(","request.query_params",")",")","return","text","io","=","gr.Interface","(","echo",",","``","textbox","''",",","``","textbox","''",")",".launch","(",")","Demos",":","request_ip_headers"]
code: def dict_to_obj(self, d):
      if isinstance(d, dict):
          return json.loads(json.dumps(d), object_hook=Obj)
      else:
          return d
  
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 2 for calling the Request obj's underlying member method code with example usage: obj.dict_to_obj(d) and returns: json, d