code: def to_raw_response_wrapper(
      func: Callable[P, R]
  ) -> Callable[P, LegacyAPIResponse[R]]:
      """Higher order function that takes one of our bound API methods and wraps it
      to support returning the raw `APIResponse` object directly.
      """
  
      @functools.wraps(func)
      def wrapped(
          *args: P.args, **kwargs: P.kwargs
      ) -> LegacyAPIResponse[R]:
          extra_headers = {
              **(cast(Any, kwargs.get("extra_headers")) or {})
          }
          extra_headers[RAW_RESPONSE_HEADER] = "true"
  
          kwargs["extra_headers"] = extra_headers
  
          return cast(LegacyAPIResponse[R], func(*args, **kwargs))
  
      return wrapped
  
imports: from __future__ import annotations
  import os
  import inspect
  import logging
  import datetime
  import functools
  from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, Iterator, AsyncIterator, cast
  from typing_extensions import Awaitable, ParamSpec, get_args, override, deprecated, get_origin
  import anyio
  import httpx
  from ._types import NoneType
  from ._utils import is_given
  from ._models import BaseModel, is_basemodel
  from ._constants import RAW_RESPONSE_HEADER
  from ._exceptions import APIResponseValidationError
label_desc: Use image node_id 2 for calling a global function with example usage: to_raw_response_wrapper(func) and returns: wrapped, cast