- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 117 for helper (0.16 sec)
-
tests/test_ws_router.py
with client.websocket_connect("/no-router/"): pass # pragma: no cover assert e.value.code == status.WS_1000_NORMAL_CLOSURE def websocket_middleware(middleware_func): """ Helper to create a Starlette pure websocket middleware """ def middleware_constructor(app): @functools.wraps(app) async def wrapped_app(scope, receive, send):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sun Jun 11 19:08:14 GMT 2023 - 7.5K bytes - Viewed (0) -
configure.py
write_to_bazelrc('build --define=override_eigen_strong_inline=true') def config_info_line(name, help_text): """Helper function to print formatted help text for Bazel config options.""" print('\t--config=%-12s\t# %s' % (name, help_text)) def configure_ios(environ_cp): """Configures TensorFlow for iOS builds.""" if not is_macos(): return
Python - Registered: Tue Apr 23 12:39:09 GMT 2024 - Last Modified: Mon Apr 15 18:25:36 GMT 2024 - 53.8K bytes - Viewed (0) -
tests/test_tutorial/test_header_params/test_tutorial002_an_py39.py
@pytest.fixture(name="client") def get_client(): from docs_src.header_params.tutorial002_an_py39 import app client = TestClient(app) return client @needs_py39 @pytest.mark.parametrize( "path,headers,expected_status,expected_response", [ ("/items", None, 200, {"strange_header": None}), ("/items", {"X-Header": "notvalid"}, 200, {"strange_header": None}), ( "/items",
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 4.2K bytes - Viewed (0) -
docs_src/header_params/tutorial002_py310.py
from fastapi import FastAPI, Header app = FastAPI() @app.get("/items/") async def read_items( strange_header: str | None = Header(default=None, convert_underscores=False), ):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 228 bytes - Viewed (0) -
docs_src/header_params/tutorial002_an.py
from typing import Union from fastapi import FastAPI, Header from typing_extensions import Annotated app = FastAPI() @app.get("/items/") async def read_items( strange_header: Annotated[ Union[str, None], Header(convert_underscores=False) ] = None, ):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 317 bytes - Viewed (0) -
docs_src/dependencies/tutorial006.py
from fastapi import Depends, FastAPI, Header, HTTPException app = FastAPI() async def verify_token(x_token: str = Header()): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def verify_key(x_key: str = Header()): if x_key != "fake-super-secret-key": raise HTTPException(status_code=400, detail="X-Key header invalid") return x_key
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 583 bytes - Viewed (0) -
docs_src/bigger_applications/app_an/dependencies.py
from fastapi import Header, HTTPException from typing_extensions import Annotated async def get_token_header(x_token: Annotated[str, Header()]): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def get_query_token(token: str): if token != "jessica":
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 419 bytes - Viewed (0) -
docs_src/header_params/tutorial001_py310.py
from fastapi import FastAPI, Header app = FastAPI() @app.get("/items/") async def read_items(user_agent: str | None = Header(default=None)):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 182 bytes - Viewed (0) -
docs_src/header_params/tutorial001.py
from typing import Union from fastapi import FastAPI, Header app = FastAPI() @app.get("/items/") async def read_items(user_agent: Union[str, None] = Header(default=None)):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 214 bytes - Viewed (0) -
docs_src/header_params/tutorial003_an_py310.py
from typing import Annotated from fastapi import FastAPI, Header app = FastAPI() @app.get("/items/") async def read_items(x_token: Annotated[list[str] | None, Header()] = None):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 221 bytes - Viewed (0)