Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for Present (0.18 sec)

  1. docs/sts/client_grants/sts_element.py

            return STSElement(self.root_name, elt) if elt is not None else None
    
        def get_child_text(self, name, strict=True):
            """Extract text of a child element. If strict, and child element is
            not present, raises InvalidXMLError and otherwise returns
            None.
    
            """
            if strict:
                try:
                    return self.element.find('sts:{}'.format(name), _STS_NS).text
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_path_params/test_tutorial005.py

        assert response.status_code == 200
        assert response.json() == {"model_name": "lenet", "message": "LeCNN all the images"}
    
    
    def test_get_enums_resnet():
        response = client.get("/models/resnet")
        assert response.status_code == 200
        assert response.json() == {"model_name": "resnet", "message": "Have some residuals"}
    
    
    def test_get_enums_invalid():
        response = client.get("/models/foo")
        assert response.status_code == 422
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 5K bytes
    - Viewed (0)
  3. tests/test_dependency_contextvars.py

    async def set_up_request_state_dependency():
        request_state = {"user": "deadpond"}
        contextvar_token = legacy_request_state_context_var.set(request_state)
        yield request_state
        legacy_request_state_context_var.reset(contextvar_token)
    
    
    @app.middleware("http")
    async def custom_middleware(
        request: Request, call_next: Callable[[Request], Awaitable[Response]]
    ):
        response = await call_next(request)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Feb 17 12:40:12 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  4. docs_src/path_params/tutorial005.py

    from enum import Enum
    
    from fastapi import FastAPI
    
    
    class ModelName(str, Enum):
        alexnet = "alexnet"
        resnet = "resnet"
        lenet = "lenet"
    
    
    app = FastAPI()
    
    
    @app.get("/models/{model_name}")
    async def get_model(model_name: ModelName):
        if model_name is ModelName.alexnet:
            return {"model_name": model_name, "message": "Deep Learning FTW!"}
    
        if model_name.value == "lenet":
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 26 13:26:03 GMT 2022
    - 546 bytes
    - Viewed (0)
  5. configure.py

      with open(
          os.path.join(_TF_WORKSPACE_ROOT, 'tools', 'python_bin_path.sh'),
          'w') as f:
        f.write('export PYTHON_BIN_PATH="{}"'.format(python_bin_path))
    
    
    def reset_tf_configure_bazelrc():
      """Reset file that contains customized config settings."""
      open(_TF_BAZELRC, 'w').close()
    
    
    def cleanup_makefile():
      """Delete any leftover BUILD files from the Makefile build.
    
    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)
  6. tests/test_dependency_normal_exceptions.py

    
    @app.put("/user/{user_id}")
    def put_user(user_id: str, name: str = Body(), db: dict = Depends(get_database)):
        db[user_id] = name
        return {"message": "OK"}
    
    
    @pytest.fixture(autouse=True)
    def reset_state_and_db():
        global fake_database
        global state
        fake_database = initial_fake_database.copy()
        state = initial_state.copy()
    
    
    client = TestClient(app)
    
    
    def test_dependency_gets_exception():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  7. docs_src/sql_databases_peewee/sql_app/main.py

    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()
            yield
        finally:
            if not database.db.is_closed():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 2.2K bytes
    - Viewed (0)
  8. docs/sts/web-identity.py

        text = '<a href="%s">Authenticate with keycloak</a>'
        return text % make_authorization_url()
    
    
    def make_authorization_url():
        # Generate a random string for the state parameter
        # Save it for use later to prevent xsrf attacks
    
        state = str(uuid4())
        params = {"client_id": client_id,
                  "response_type": "code",
                  "state": state,
                  "redirect_uri": callback_uri,
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jul 28 01:37:51 GMT 2021
    - 2.9K bytes
    - Viewed (1)
Back to top