Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 256 for Onot (0.3 sec)

  1. tests/test_starlette_exception.py

    app = FastAPI()
    
    items = {"foo": "The Foo Wrestlers"}
    
    
    @app.get("/items/{item_id}")
    async def read_item(item_id: str):
        if item_id not in items:
            raise HTTPException(
                status_code=404,
                detail="Item not found",
                headers={"X-Error": "Some custom header"},
            )
        return {"item": items[item_id]}
    
    
    @app.get("/http-no-body-statuscode-exception")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  2. docs_src/security/tutorial005_an.py

            user_dict = db[username]
            return UserInDB(**user_dict)
    
    
    def authenticate_user(fake_db, username: str, password: str):
        user = get_user(fake_db, username)
        if not user:
            return False
        if not verify_password(password, user.hashed_password):
            return False
        return user
    
    
    def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
        to_encode = data.copy()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  3. tensorflow/api_template.__init__.py

    """
    # pylint: disable=g-bad-import-order,protected-access,g-import-not-at-top
    
    import distutils as _distutils
    import importlib
    import inspect as _inspect
    import os as _os
    import site as _site
    import sys as _sys
    
    # Do not remove this line; See https://github.com/tensorflow/tensorflow/issues/42596
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Tue Mar 05 06:27:59 GMT 2024
    - 6.7K bytes
    - Viewed (3)
  4. .github/actions/notify-translations/app/main.py

        label_strs = {label.name for label in pr.get_labels()}
        langs = []
        for label in label_strs:
            if label.startswith("lang-") and not label == lang_all_label:
                langs.append(label[5:])
        logging.info(f"PR #{pr.number} has labels: {label_strs}")
        if not langs or lang_all_label not in label_strs:
            logging.info(f"PR #{pr.number} doesn't seem to be a translation PR, skipping")
            sys.exit(0)
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  5. docs/sts/client_grants/sts_element.py

            """
            elt = self.element.find('sts:{}'.format(name), _STS_NS)
            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:
    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)
  6. docs_src/security/tutorial004_an_py310.py

            user_dict = db[username]
            return UserInDB(**user_dict)
    
    
    def authenticate_user(fake_db, username: str, password: str):
        user = get_user(fake_db, username)
        if not user:
            return False
        if not verify_password(password, user.hashed_password):
            return False
        return user
    
    
    def create_access_token(data: dict, expires_delta: timedelta | None = None):
        to_encode = data.copy()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_security/test_tutorial005_py39.py

    
    @needs_py39
    def test_no_token(client: TestClient):
        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    @needs_py39
    def test_token(client: TestClient):
        access_token = get_access_token(scope="me", client=client)
        response = client.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  8. docs_src/additional_responses/tutorial003.py

    class Message(BaseModel):
        message: str
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
        response_model=Item,
        responses={
            404: {"model": Message, "description": "The item was not found"},
            200: {
                "description": "Item requested by ID",
                "content": {
                    "application/json": {
                        "example": {"id": "bar", "value": "The bar tenders"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 837 bytes
    - Viewed (0)
  9. docs_src/dependencies/tutorial008b_an_py39.py

    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id not in data:
            raise HTTPException(status_code=404, detail="Item not found")
        item = data[item_id]
        if item["owner"] != username:
            raise OwnerError(username)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Dec 26 20:37:34 GMT 2023
    - 775 bytes
    - Viewed (0)
  10. docs/sts/client_grants/__init__.py

            self.csec = csec
            self.idp_ep = idp_ep
            self.sts_ep = sts_ep
    
            # Load CA certificates from SSL_CERT_FILE file if set
            ca_certs = os.environ.get('SSL_CERT_FILE')
            if not ca_certs:
                ca_certs = certifi.where()
    
            self._http = urllib3.PoolManager(
                timeout=urllib3.Timeout.DEFAULT_TIMEOUT,
                maxsize=10,
                cert_reqs='CERT_NONE',
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 4.6K bytes
    - Viewed (1)
Back to top