Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for counter (0.19 sec)

  1. .github/actions/people/app/main.py

    class ContributorsResults(BaseModel):
        contributors: Counter
        commenters: Counter
        reviewers: Counter
        translation_reviewers: Counter
        authors: Dict[str, Author]
    
    
    def get_contributors(pr_nodes: List[PullRequestNode]) -> ContributorsResults:
        contributors = Counter()
        commenters = Counter()
        reviewers = Counter()
        translation_reviewers = Counter()
        authors: Dict[str, Author] = {}
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  2. ci/official/containers/linux_arm64/devel.usertools/squash_testlogs.py

      )
    except subprocess.CalledProcessError as e:
      print("No failures found to log!")
      exit(0)
    
    # For test cases, only show the ones that failed that have text (a log)
    seen = collections.Counter()
    runfiles_matcher = re.compile(r"(/.*\.runfiles/)")
    
    
    for f in files.strip().splitlines():
      # Just ignore any failures, they're probably not important
      try:
        r = JUnitXml.fromfile(f)
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Sep 18 19:00:37 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  3. tests/test_dependency_cache.py

    app = FastAPI()
    
    counter_holder = {"counter": 0}
    
    
    async def dep_counter():
        counter_holder["counter"] += 1
        return counter_holder["counter"]
    
    
    async def super_dep(count: int = Depends(dep_counter)):
        return count
    
    
    @app.get("/counter/")
    async def get_counter(count: int = Depends(dep_counter)):
        return {"counter": count}
    
    
    @app.get("/sub-counter/")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Aug 23 13:30:24 GMT 2022
    - 2.7K bytes
    - Viewed (0)
  4. tests/test_router_redirect_slashes.py

    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    
    
    def test_redirect_slashes_enabled():
        app = FastAPI()
        router = APIRouter()
    
        @router.get("/hello/")
        def hello_page() -> str:
            return "Hello, World!"
    
        app.include_router(router)
    
        client = TestClient(app)
    
        response = client.get("/hello/", follow_redirects=False)
        assert response.status_code == 200
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jun 22 10:37:50 GMT 2023
    - 974 bytes
    - Viewed (0)
  5. tests/test_include_router_defaults_overrides.py

        callbacks=callback_router3.routes,
    )
    
    router2_override.include_router(router4_override)
    
    router2_override.include_router(router4_default)
    
    router2_default.include_router(
        router4_override,
        prefix="/level3",
        tags=["level3a", "level3b"],
        dependencies=[Depends(dep3)],
        responses={
            403: {"description": "Client error level 3"},
            503: {"description": "Server error level 3"},
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 358.6K bytes
    - Viewed (0)
  6. tests/test_router_prefix_with_template.py

    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    router = APIRouter()
    
    
    @router.get("/users/{id}")
    def read_user(segment: str, id: str):
        return {"segment": segment, "id": id}
    
    
    app.include_router(router, prefix="/{segment}")
    
    
    client = TestClient(app)
    
    
    def test_get():
        response = client.get("/seg/users/foo")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 484 bytes
    - Viewed (0)
  7. tests/test_ws_router.py

    def test_router():
        client = TestClient(app)
        with client.websocket_connect("/router") as websocket:
            data = websocket.receive_text()
            assert data == "Hello, router!"
    
    
    def test_prefix_router():
        client = TestClient(app)
        with client.websocket_connect("/prefix/") as websocket:
            data = websocket.receive_text()
            assert data == "Hello, router with prefix!"
    
    
    def test_native_prefix_router():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  8. tests/test_default_response_class_router.py

    )
    router_b_override.include_router(router_b_a, prefix="/a")
    router_a.include_router(router_a_a, prefix="/a")
    router_a.include_router(
        router_a_b_override, prefix="/b", default_response_class=PlainTextResponse
    )
    app.include_router(router_a, prefix="/a")
    app.include_router(
        router_b_override, prefix="/b", default_response_class=PlainTextResponse
    )
    
    
    client = TestClient(app)
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Mar 01 20:49:20 GMT 2020
    - 5K bytes
    - Viewed (0)
  9. tests/test_additional_responses_router.py

        message: str
    
    
    app = FastAPI()
    router = APIRouter()
    
    
    @router.get("/a", responses={501: {"description": "Error 1"}})
    async def a():
        return "a"
    
    
    @router.get(
        "/b",
        responses={
            502: {"description": "Error 2"},
            "4XX": {"description": "Error with range, upper"},
        },
    )
    async def b():
        return "b"
    
    
    @router.get(
        "/c",
        responses={
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  10. docs_src/nosql_databases/tutorial001.py

    from typing import Union
    
    from couchbase import LOCKMODE_WAIT
    from couchbase.bucket import Bucket
    from couchbase.cluster import Cluster, PasswordAuthenticator
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    USERPROFILE_DOC_TYPE = "userprofile"
    
    
    def get_bucket():
        cluster = Cluster(
            "couchbase://couchbasehost:8091?fetch_mutation_tokens=1&operation_timeout=30&n1ql_timeout=300"
        )
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 1.3K bytes
    - Viewed (0)
Back to top