Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for slate (0.18 sec)

  1. docs_src/sql_databases_peewee/sql_app/database.py

    from contextvars import ContextVar
    
    import peewee
    
    DATABASE_NAME = "test.db"
    db_state_default = {"closed": None, "conn": None, "ctx": None, "transactions": None}
    db_state = ContextVar("db_state", default=db_state_default.copy())
    
    
    class PeeweeConnectionState(peewee._ConnectionState):
        def __init__(self, **kwargs):
            super().__setattr__("_state", db_state)
            super().__init__(**kwargs)
    
        def __setattr__(self, name, value):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 662 bytes
    - Viewed (0)
  2. tests/test_dependency_contextvars.py

    legacy_request_state_context_var: ContextVar[Optional[Dict[str, Any]]] = ContextVar(
        "legacy_request_state_context_var", default=None
    )
    
    app = FastAPI()
    
    
    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)
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Feb 17 12:40:12 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  3. .github/actions/people/app/main.py

    
    class ReviewNode(BaseModel):
        author: Union[Author, None] = None
        state: str
    
    
    class Reviews(BaseModel):
        nodes: List[ReviewNode]
    
    
    class PullRequestNode(BaseModel):
        number: int
        labels: Labels
        author: Union[Author, None] = None
        title: str
        createdAt: datetime
        state: str
        comments: Comments
        reviews: Reviews
    
    
    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)
  4. .github/actions/notify-translations/app/main.py

                    already_done_comment = comment
            logging.info(
                f"Already notified comment: {already_notified_comment}, already done comment: {already_done_comment}"
            )
    
            if pr.state == "open" and awaiting_label in label_strs:
                logging.info(
                    f"This PR seems to be a language translation and awaiting reviews: #{pr.number}"
                )
                if already_notified_comment:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  5. 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 May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 2.2K bytes
    - Viewed (0)
  6. docs/sts/web-identity.py

        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,
                  "scope": "openid"}
    
    Python
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Jul 28 01:37:51 GMT 2021
    - 2.9K bytes
    - Viewed (1)
  7. 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 May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  8. tests/test_dependency_contextmanager.py

    class OtherDependencyError(Exception):
        pass
    
    
    async def asyncgen_state(state: Dict[str, str] = Depends(get_state)):
        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"
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  9. fastapi/openapi/docs.py

                            level: "warning",
                            message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
                        });
                    }
    
                    if (qp.code) {
                        delete oauth2.state;
                        oauth2.auth.code = qp.code;
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  10. fastapi/applications.py

                    """
                ),
            ] = webhooks or routing.APIRouter()
            self.root_path = root_path or openapi_prefix
            self.state: Annotated[
                State,
                Doc(
                    """
                    A state object for the application. This is the same object for the
                    entire application, it doesn't change from request to request.
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
Back to top