Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for computed (0.32 sec)

  1. tests/test_computed_fields.py

    from .utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        app = FastAPI()
    
        from pydantic import BaseModel, computed_field
    
        class Rectangle(BaseModel):
            width: int
            length: int
    
            @computed_field
            @property
            def area(self) -> int:
                return self.width * self.length
    
        @app.get("/")
        def read_root() -> Rectangle:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  2. tests/test_modules_same_name_body/test_main.py

                        },
                        "summary": "Compute",
                        "operationId": "compute_a_compute_post",
                        "requestBody": {
                            "content": {
                                "application/json": {
                                    "schema": {
                                        "$ref": "#/components/schemas/Body_compute_a_compute_post"
                                    }
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_async_sql_databases/test_tutorial001.py

        with TestClient(app) as client:
            note = {"text": "Foo bar", "completed": False}
            response = client.post("/notes/", json=note)
            assert response.status_code == 200, response.text
            data = response.json()
            assert data["text"] == note["text"]
            assert data["completed"] == note["completed"]
            assert "id" in data
            response = client.get("/notes/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 6K bytes
    - Viewed (0)
  4. tests/test_modules_same_name_body/app/a.py

    from fastapi import APIRouter, Body
    
    router = APIRouter()
    
    
    @router.post("/compute")
    def compute(a: int = Body(), b: str = Body()):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 160 bytes
    - Viewed (0)
  5. ci/official/utilities/extract_resultstore_links.py

    RESULT_STORE_LINK_RE = re.compile(
        r'^INFO: Streaming build results to: (https://[\w./\-]+)')
    FAILED_BUILD_LINE = 'FAILED: Build did NOT complete successfully'
    BUILD_STATUS_LINE = 'INFO: Build'
    TESTS_FAILED_RE = re.compile(r'^INFO: Build completed, \d+ tests? FAILED')
    BAZEL_COMMAND_RE = re.compile(
        r'(^| )(?P<command>bazel (.*? )?(?P<type>test|build) .+)')
    
    
    class InvokeStatus:
      tests_failed = 'tests_failed'
      build_failed = 'build_failed'
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Wed Nov 08 17:50:27 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  6. tests/test_modules_same_name_body/app/b.py

    from fastapi import APIRouter, Body
    
    router = APIRouter()
    
    
    @router.post("/compute/")
    def compute(a: int = Body(), b: str = Body()):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 161 bytes
    - Viewed (0)
  7. tests/test_dependency_contextmanager.py

        state["/async"] = "asyncgen started"
        yield state["/async"]
        state["/async"] = "asyncgen completed"
    
    
    def generator_state(state: Dict[str, str] = Depends(get_state)):
        state["/sync"] = "generator started"
        yield state["/sync"]
        state["/sync"] = "generator completed"
    
    
    async def asyncgen_state_try(state: Dict[str, str] = Depends(get_state)):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  8. configure.py

      return output
    
    
    def set_tf_cuda_compute_capabilities(environ_cp):
      """Set TF_CUDA_COMPUTE_CAPABILITIES."""
      while True:
        native_cuda_compute_capabilities = get_native_cuda_compute_capabilities(
            environ_cp)
        if not native_cuda_compute_capabilities:
          default_cuda_compute_capabilities = _DEFAULT_CUDA_COMPUTE_CAPABILITIES
        else:
          default_cuda_compute_capabilities = native_cuda_compute_capabilities
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 18:25:36 GMT 2024
    - 53.8K bytes
    - Viewed (0)
  9. docs_src/async_sql_databases/tutorial001.py

        sqlalchemy.Column("completed", sqlalchemy.Boolean),
    )
    
    
    engine = sqlalchemy.create_engine(
        DATABASE_URL, connect_args={"check_same_thread": False}
    )
    metadata.create_all(engine)
    
    
    class NoteIn(BaseModel):
        text: str
        completed: bool
    
    
    class Note(BaseModel):
        id: int
        text: str
        completed: bool
    
    
    app = FastAPI()
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 1.4K bytes
    - Viewed (0)
Back to top