- Sort Score
- Result 10 results
- Languages All
Results 121 - 130 of 4,280 for From (0.02 sec)
-
tensorflow/api_template.__init__.py
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow # pylint: disable=unused-import from tensorflow.python.tools import module_util as _module_util from tensorflow.python.util.lazy_loader import KerasLazyLoader as _KerasLazyLoader # Make sure code inside the TensorFlow codebase can use tf2.enabled() at import. _os.environ["TF2_BEHAVIOR"] = "1" from tensorflow.python import tf2 as _tf2
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Wed Oct 02 22:16:02 UTC 2024 - 6.8K bytes - Viewed (0) -
tests/test_security_oauth2_password_bearer_optional_description.py
from typing import Optional from fastapi import FastAPI, Security from fastapi.security import OAuth2PasswordBearer from fastapi.testclient import TestClient app = FastAPI() oauth2_scheme = OAuth2PasswordBearer( tokenUrl="/token", description="OAuth2PasswordBearer security scheme", auto_error=False, ) @app.get("/items/") async def read_items(token: Optional[str] = Security(oauth2_scheme)): if token is None:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.2K bytes - Viewed (0) -
tests/test_security_openid_connect.py
from fastapi import Depends, FastAPI, Security from fastapi.security.open_id_connect_url import OpenIdConnect from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() oid = OpenIdConnect(openIdConnectUrl="/openid") class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(oid)): user = User(username=oauth_header) return user
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.2K bytes - Viewed (0) -
tests/test_security_openid_connect_description.py
from fastapi import Depends, FastAPI, Security from fastapi.security.open_id_connect_url import OpenIdConnect from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() oid = OpenIdConnect( openIdConnectUrl="/openid", description="OpenIdConnect security scheme" ) class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(oid)):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.4K bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial009.py
from pathlib import Path from fastapi.testclient import TestClient from docs_src.custom_response import tutorial009 from docs_src.custom_response.tutorial009 import app client = TestClient(app) def test_get(tmp_path: Path): file_path: Path = tmp_path / "large-video-file.mp4" tutorial009.some_file_path = str(file_path) test_content = b"Fake video bytes" file_path.write_bytes(test_content) response = client.get("/")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Jul 03 19:51:28 UTC 2021 - 487 bytes - Viewed (0) -
docs_src/header_param_models/tutorial001_an.py
from typing import List, Union from fastapi import FastAPI, Header from pydantic import BaseModel from typing_extensions import Annotated app = FastAPI() class CommonHeaders(BaseModel): host: str save_data: bool if_modified_since: Union[str, None] = None traceparent: Union[str, None] = None x_tag: List[str] = [] @app.get("/items/") async def read_items(headers: Annotated[CommonHeaders, Header()]):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 446 bytes - Viewed (0) -
docs_src/wsgi/tutorial001.py
from fastapi import FastAPI from fastapi.middleware.wsgi import WSGIMiddleware from flask import Flask, request from markupsafe import escape flask_app = Flask(__name__) @flask_app.route("/") def flask_main(): name = request.args.get("name", "World") return f"Hello, {escape(name)} from Flask!" app = FastAPI() @app.get("/v2") def read_main(): return {"message": "Hello World"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue May 09 14:32:00 UTC 2023 - 443 bytes - Viewed (0) -
tests/test_filter_pydantic_sub_model_pv2.py
from typing import Optional import pytest from dirty_equals import HasRepr, IsDict, IsOneOf from fastapi import Depends, FastAPI from fastapi.exceptions import ResponseValidationError from fastapi.testclient import TestClient from .utils import needs_pydanticv2 @pytest.fixture(name="client") def get_client(): from pydantic import BaseModel, ValidationInfo, field_validator app = FastAPI() class ModelB(BaseModel):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 6.3K bytes - Viewed (0) -
tests/test_callable_endpoint.py
from functools import partial from typing import Optional from fastapi import FastAPI from fastapi.testclient import TestClient def main(some_arg, q: Optional[str] = None): return {"some_arg": some_arg, "q": q} endpoint = partial(main, "foo") app = FastAPI() app.get("/")(endpoint) client = TestClient(app) def test_partial(): response = client.get("/?q=bar") data = response.json()
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Jun 28 18:13:30 UTC 2020 - 457 bytes - Viewed (0) -
docs_src/bigger_applications/app_an/main.py
from fastapi import Depends, FastAPI from .dependencies import get_query_token, get_token_header from .internal import admin from .routers import items, users app = FastAPI(dependencies=[Depends(get_query_token)]) app.include_router(users.router) app.include_router(items.router) app.include_router( admin.router, prefix="/admin", tags=["admin"], dependencies=[Depends(get_token_header)],
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 552 bytes - Viewed (0)