# Path: starlette/types.py

# 
# Path: starlette/websockets.py
# class WebSocketDisconnect(Exception):
#     def __init__(self, code: int = 1000, reason: str = None) -> None:
#         self.code = code
#         self.reason = reason or ""


import asyncio
import contextlib
import http
import inspect
import io
import json
import math
import queue
import sys
import types
import typing
import anyio.abc
import requests
from concurrent.futures import Future
from urllib.parse import unquote, urljoin, urlsplit
from anyio.streams.stapled import StapledObjectStream
from starlette.types import Message, Receive, Scope, Send
from starlette.websockets import WebSocketDisconnect
    from typing import TypedDict
    from typing_extensions import TypedDict
                "headers": headers,
                "client": ["testclient", 50000],
                "server": [host, port],
                "subprotocols": subprotocols,
            }
            session = WebSocketTestSession(self.app, scope, self.portal_factory)
            raise _Upgrade(session)

        scope = {
            "type": "http",
            "http_version": "1.1",
            "method": request.method,
            "path": unquote(path),
            "raw_path": path.encode(),
            "root_path": self.root_path,
            "scheme": scheme,
            "query_string": query.encode(),
            "headers": headers,
            "client": ["testclient", 50000],
            "server": [host, port],
            "extensions": {"http.response.template": {}},
        }

        request_complete = False
        response_started = False
        response_complete: anyio.Event
        raw_kwargs: typing.Dict[str, typing.Any] = {"body": io.BytesIO()}
        template = None
        context = None


# Path: starlette/types.py

# 
# Path: starlette/websockets.py
# class WebSocketDisconnect(Exception):
#     def __init__(self, code: int = 1000, reason: str = None) -> None:
#         self.code = code
#         self.reason = reason or ""


# Path: starlette/testclient.py
import asyncio
import contextlib
import http
import inspect
import io
import json
import math
import queue
import sys
import types
import typing
import anyio.abc
import requests
from concurrent.futures import Future
from urllib.parse import unquote, urljoin, urlsplit
from anyio.streams.stapled import StapledObjectStream
from starlette.types import Message, Receive, Scope, Send
from starlette.websockets import WebSocketDisconnect
    from typing import TypedDict
    from typing_extensions import TypedDict

                "headers": headers,
                "client": ["testclient", 50000],
                "server": [host, port],
                "subprotocols": subprotocols,
            }
            session = WebSocketTestSession(self.app, scope, self.portal_factory)
            raise _Upgrade(session)

        scope = {
            "type": "http",
            "http_version": "1.1",
            "method": request.method,
            "path": unquote(path),
            "raw_path": path.encode(),
            "root_path": self.root_path,
            "scheme": scheme,
            "query_string": query.encode(),
            "headers": headers,
            "client": ["testclient", 50000],
            "server": [host, port],
            "extensions": {"http.response.template": {}},
        }

        request_complete = False
        response_started = False
        response_complete: anyio.Event
        raw_kwargs: typing.Dict[str, typing.Any] = {"body": io.BytesIO()}
        template = None
        context = None


        async def receive() -> Message: