class_docstr: Wraps a user-provided callable that is used to handle requests to a replica.
class_docstr_tok: ["Wraps","a","user-provided","callable","that","is","used","to","handle","requests","to","a","replica","."]
docstr: Prepare arguments for a user method handling an HTTP request.
  
  Returns (request_args, asgi_args, receive_task).
  
  The returned `receive_task` should be cancelled when the user method exits.
docstr_tok: ["Prepare","arguments","for","a","user","method","handling","an","HTTP","request",".","Returns","(","request_args",",","asgi_args",",","receive_task",")",".","The","returned","`","receive_task","`","should","be","cancelled","when","the","user","method","exits","."]
code: def _prepare_args_for_http_request(
      self,
      request: StreamingHTTPRequest,
      request_metadata: RequestMetadata,
      user_method_params: Dict[str, inspect.Parameter],
      *,
      is_asgi_app: bool,
      generator_result_callback: Optional[Callable] = None,
  ) -> Tuple[Tuple[Any], ASGIArgs, asyncio.Task]:
      """Prepare arguments for a user method handling an HTTP request.
  
      Returns (request_args, asgi_args, receive_task).
  
      The returned `receive_task` should be cancelled when the user method exits.
      """
      receive = ASGIReceiveProxy(
          request_metadata.request_id,
          request.http_proxy_handle,
      )
      receive_task = self._event_loop.create_task(
          receive.fetch_until_disconnect()
      )
      asgi_args = ASGIArgs(
          scope=pickle.loads(request.pickled_asgi_scope),
          receive=receive,
          send=generator_result_callback,
      )
      if is_asgi_app:
          request_args = asgi_args.to_args_tuple()
      elif len(user_method_params) == 0:
          # Edge case to support empty HTTP handlers: don't pass the Request
          # argument if the callable has no parameters.
          request_args = tuple()
      else:
          # Non-FastAPI HTTP handlers take only the starlette `Request`.
          request_args = (asgi_args.to_starlette_request(),)
  
      return request_args, asgi_args, receive_task
  
imports: import asyncio
  import inspect
  import logging
  import os
  import pickle
  import time
  import traceback
  from contextlib import contextmanager
  from importlib import import_module
  from typing import Any, AsyncGenerator, Callable, Dict, Optional, Tuple, Union
  import starlette.responses
  import ray
  from ray import cloudpickle
  from ray._private.utils import get_or_create_event_loop
  from ray.actor import ActorClass
  from ray.remote_function import RemoteFunction
  from ray.serve import metrics
  from ray.serve._private.autoscaling_metrics import InMemoryMetricsStore
  from ray.serve._private.common import DeploymentID, ReplicaName, ReplicaTag, ServeComponentType, StreamingHTTPRequest, gRPCRequest
  from ray.serve._private.config import DeploymentConfig
  from ray.serve._private.constants import DEFAULT_LATENCY_BUCKET_MS, GRPC_CONTEXT_ARG_NAME, HEALTH_CHECK_METHOD, RAY_SERVE_GAUGE_METRIC_SET_PERIOD_S, RAY_SERVE_REPLICA_AUTOSCALING_METRIC_RECORD_PERIOD_S, RECONFIGURE_METHOD, REPLICA_CONTROL_PLANE_CONCURRENCY_GROUP, SERVE_CONTROLLER_NAME, SERVE_LOGGER_NAME, SERVE_NAMESPACE
  from ray.serve._private.http_util import ASGIAppReplicaWrapper, ASGIArgs, ASGIReceiveProxy, MessageQueue, Response
  from ray.serve._private.logging_utils import access_log_msg, configure_component_cpu_profiler, configure_component_logger, configure_component_memory_profiler, get_component_logger_file_path
  from ray.serve._private.router import RequestMetadata
  from ray.serve._private.utils import MetricsPusher, merge_dict, parse_import_path, wrap_to_ray_error
  from ray.serve._private.version import DeploymentVersion
  from ray.serve.config import AutoscalingConfig
  from ray.serve.deployment import Deployment
  from ray.serve.exceptions import RayServeException
  from ray.serve.schema import LoggingConfig
label_desc: Use image node_id 4 for calling the UserCallableWrapper obj's underlying member method code with example usage: obj._prepare_args_for_http_request(request, request_metadata, user_method_params) and returns: request_args,  asgi_args,  receive_task