Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 268 for stats (0.15 sec)

  1. docs/select/select.py

            print("Stats details bytesScanned: ")
            print(statsDetails['BytesScanned'])
            print("Stats details bytesProcessed: ")
    Python
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Aug 18 00:11:39 GMT 2018
    - 1K bytes
    - Viewed (0)
  2. docs_src/sql_databases_peewee/sql_app/main.py

    from .database import db_state_default
    
    database.db.connect()
    database.db.create_tables([models.User, models.Item])
    database.db.close()
    
    app = FastAPI()
    
    sleep_time = 10
    
    
    async def reset_db_state():
        database.db._state._state.set(db_state_default.copy())
        database.db._state.reset()
    
    
    def get_db(db_state=Depends(reset_db_state)):
        try:
            database.db.connect()
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 2.2K bytes
    - Viewed (0)
  3. docs_src/sql_databases/sql_app_py39/alt_main.py

        response = Response("Internal server error", status_code=500)
        try:
            request.state.db = SessionLocal()
            response = await call_next(request)
        finally:
            request.state.db.close()
        return response
    
    
    # Dependency
    def get_db(request: Request):
        return request.state.db
    
    
    @app.post("/users/", response_model=schemas.User)
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  4. tests/test_required_noneable.py

        response = client.get("/query")
        assert response.status_code == 422
    
    
    def test_required_noneable_query_value():
        response = client.get("/query", params={"q": "foo"})
        assert response.status_code == 200
        assert response.json() == "foo"
    
    
    def test_required_nonable_explicit_query_invalid():
        response = client.get("/explicit-query")
        assert response.status_code == 422
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat May 14 19:08:31 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  5. tests/test_dependency_cache.py

        assert response.status_code == 200, response.text
        assert response.json() == {"counter": 1}
        response = client.get("/counter/")
        assert response.status_code == 200, response.text
        assert response.json() == {"counter": 2}
    
    
    def test_sub_counter():
        counter_holder["counter"] = 0
        response = client.get("/sub-counter/")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Aug 23 13:30:24 GMT 2022
    - 2.7K bytes
    - Viewed (0)
  6. docs_src/security/tutorial005_an_py310.py

    ):
        return [{"item_id": "Foo", "owner": current_user.username}]
    
    
    @app.get("/status/")
    async def read_system_status(current_user: Annotated[User, Depends(get_current_user)]):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  7. docs_src/security/tutorial005_py310.py

        current_user: User = Security(get_current_active_user, scopes=["items"]),
    ):
        return [{"item_id": "Foo", "owner": current_user.username}]
    
    
    @app.get("/status/")
    async def read_system_status(current_user: User = Depends(get_current_user)):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_first_steps/test_tutorial001.py

    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            ("/", 200, {"message": "Hello World"}),
            ("/nonexistent", 404, {"detail": "Not Found"}),
        ],
    )
    def test_get_path(path, expected_status, expected_response):
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  9. docs_src/security/tutorial003.py

        if not user:
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Invalid authentication credentials",
                headers={"WWW-Authenticate": "Bearer"},
            )
        return user
    
    
    async def get_current_active_user(current_user: User = Depends(get_current_user)):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 2.4K bytes
    - Viewed (0)
  10. docs_src/response_change_status_code/tutorial001.py

    from fastapi import FastAPI, Response, status
    
    app = FastAPI()
    
    tasks = {"foo": "Listen to the Bar Fighters"}
    
    
    @app.put("/get-or-create-task/{task_id}", status_code=200)
    def get_or_create_task(task_id: str, response: Response):
        if task_id not in tasks:
            tasks[task_id] = "This didn't exist before"
            response.status_code = status.HTTP_201_CREATED
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 391 bytes
    - Viewed (0)
Back to top