Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 231 - 240 of 402 for item_2 (0.05 seconds)

  1. tests/test_tuples.py

                                "items": {
                                    "title": "Items",
                                    "type": "array",
                                    "items": {
                                        "maxItems": 2,
                                        "minItems": 2,
                                        "type": "array",
                                        "prefixItems": [
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 10.8K bytes
    - Click Count (0)
  2. internal/store/queuestore.go

    	}
    
    	return raw, err
    }
    
    // Get - gets an item from the store.
    func (store *QueueStore[I]) Get(key Key) (item I, err error) {
    	items, err := store.GetMultiple(key)
    	if err != nil {
    		return item, err
    	}
    	return items[0], nil
    }
    
    // GetMultiple will read the multi payload file and fetch the items
    func (store *QueueStore[I]) GetMultiple(key Key) (items []I, err error) {
    	raw, err := store.GetRaw(key)
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Sun Sep 28 20:59:21 GMT 2025
    - 7.8K bytes
    - Click Count (0)
  3. internal/store/batch_test.go

    	}
    	if key.ItemCount != int(limit) {
    		t.Fatalf("expected key.ItemCount=%d; but got %v", limit, key.ItemCount)
    	}
    	items, err := store.GetMultiple(key)
    	if err != nil {
    		t.Fatalf("unable to read key %v; %v", key.String(), err)
    	}
    	if len(items) != int(limit) {
    		t.Fatalf("expected len(items)=%d; but got %v", limit, len(items))
    	}
    }
    
    func TestBatchCommitOnExit(t *testing.T) {
    	defer func() {
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Fri Aug 29 02:39:48 GMT 2025
    - 5.6K bytes
    - Click Count (0)
  4. tests/test_security_oauth2_password_bearer_optional_description.py

        auto_error=False,
    )
    
    
    @app.get("/items/")
    async def read_items(token: str | None = Security(oauth2_scheme)):
        if token is None:
            return {"msg": "Create an account first"}
        return {"token": token}
    
    
    client = TestClient(app)
    
    
    def test_no_token():
        response = client.get("/items")
        assert response.status_code == 200, response.text
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  5. docs/ja/docs/python-types.md

    /// info | 情報
    
    角括弧内の内部の型は「型パラメータ」と呼ばれています。
    
    この場合、`str` は `list` に渡される型パラメータです。
    
    ///
    
    つまり: 変数 `items` は `list` であり、このリストの各項目は `str` です。
    
    そうすることで、エディタはリストの項目を処理している間にもサポートを提供できます。
    
    <img src="/img/python-types/image05.png">
    
    型がなければ、それはほぼ不可能です。
    
    変数 `item` はリスト `items` の要素の一つであることに注意してください。
    
    それでも、エディタはそれが `str` であることを知っていて、そのためのサポートを提供しています。
    
    #### Tuple と Set { #tuple-and-set }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 14.3K bytes
    - Click Count (0)
  6. docs/en/docs/tutorial/path-params-numeric-validations.md

    ///
    
    ## Declare metadata { #declare-metadata }
    
    You can declare all the same parameters as for `Query`.
    
    For example, to declare a `title` metadata value for the path parameter `item_id` you can type:
    
    {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[10] *}
    
    /// note
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 6.1K bytes
    - Click Count (0)
  7. tests/test_security_oauth2_authorization_code_bearer_scopes_openapi.py

        return {"message": "Admin Access"}
    
    
    router = APIRouter(dependencies=[Security(oauth2_scheme, scopes=["read"])])
    
    
    @router.get("/items/")
    async def read_items(token: str | None = Depends(oauth2_scheme)):
        return {"token": token}
    
    
    @router.post("/items/")
    async def create_item(
        token: str | None = Security(oauth2_scheme, scopes=["read", "write"]),
    ):
        return {"token": token}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 6.6K bytes
    - Click Count (0)
  8. docs/zh/docs/tutorial/bigger-applications.md

    ///
    
    ## 其他使用 `APIRouter` 的模块 { #another-module-with-apirouter }
    
    假设你在位于 `app/routers/items.py` 的模块中还有专门用于处理应用程序中「项目」的端点。
    
    你具有以下*路径操作*:
    
    * `/items/`
    * `/items/{item_id}`
    
    这和 `app/routers/users.py` 的结构完全相同。
    
    但是我们想变得更聪明并简化一些代码。
    
    我们知道此模块中的所有*路径操作*都有相同的:
    
    * 路径 `prefix`:`/items`。
    * `tags`:(仅有一个 `items` 标签)。
    * 额外的 `responses`。
    * `dependencies`:它们都需要我们创建的 `X-Token` 依赖项。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 19.5K bytes
    - Click Count (0)
  9. tests/test_invalid_sequence_param.py

        ):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
            def read_items(q: tuple[Item, Item] = Query(default=None)):
                pass  # pragma: no cover
    
    
    def test_invalid_dict():
        with pytest.raises(
            AssertionError,
            match="Query parameter 'q' must be one of the supported types",
        ):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 1.5K bytes
    - Click Count (0)
  10. docs/zh-hant/docs/deployment/docker.md

    ```Python
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: str | None = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### Dockerfile { #dockerfile }
    
    現在在同一個專案目錄建立一個 `Dockerfile` 檔案,內容如下:
    
    ```{ .dockerfile .annotate }
    # (1)!
    FROM python:3.14
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 24.9K bytes
    - Click Count (0)
Back to Top