Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 311 - 320 of 1,062 for python (0.04 seconds)

  1. docs/ja/docs/advanced/middleware.md

    そのため、サードパーティの ASGI ミドルウェアのドキュメントでは、おそらく次のように書かれているでしょう:
    
    ```Python
    from unicorn import UnicornMiddleware
    
    app = SomeASGIApp()
    
    new_app = UnicornMiddleware(app, some_config="rainbow")
    ```
    
    しかし FastAPI(正確には Starlette)は、内部ミドルウェアがサーバーエラーを処理し、カスタム例外ハンドラが正しく動作することを保証する、より簡単な方法を提供しています。
    
    そのためには(CORS の例と同様に)`app.add_middleware()` を使います。
    
    ```Python
    from fastapi import FastAPI
    from unicorn import UnicornMiddleware
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 5.2K bytes
    - Click Count (0)
  2. docs/en/docs/advanced/advanced-dependencies.md

    But we want to be able to parameterize that fixed content.
    
    ## A "callable" instance { #a-callable-instance }
    
    In Python there's a way to make an instance of a class a "callable".
    
    Not the class itself (which is already a callable), but an instance of that class.
    
    To do that, we declare a method `__call__`:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 9K bytes
    - Click Count (0)
  3. docs/zh-hant/docs/fastapi-cli.md

    entrypoint = "main:app"
    ```
    
    這個 `entrypoint` 會告訴 `fastapi` 指令應該像這樣匯入 app:
    
    ```python
    from main import app
    ```
    
    如果你的程式碼結構是這樣:
    
    ```
    .
    ├── backend
    │   ├── main.py
    │   ├── __init__.py
    ```
    
    那麼你應該把 `entrypoint` 設為:
    
    ```toml
    [tool.fastapi]
    entrypoint = "backend.main:app"
    ```
    
    這等同於:
    
    ```python
    from backend.main import app
    ```
    
    ### 帶路徑的 `fastapi dev` { #fastapi-dev-with-path }
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 5.8K bytes
    - Click Count (0)
  4. docs/ja/docs/tutorial/dependencies/index.md

    ```Python
    commons: Annotated[dict, Depends(common_parameters)]
    ```
    
    しかし、`Annotated` を使用しているので、その `Annotated` 値を変数に格納して複数箇所で使えます:
    
    {* ../../docs_src/dependencies/tutorial001_02_an_py310.py hl[12,16,21] *}
    
    /// tip | 豆知識
    
    これはただの標準 Python で、「type alias」と呼ばれ、**FastAPI** 固有のものではありません。
    
    しかし **FastAPI** は `Annotated` を含む Python 標準に基づいているため、このテクニックをコードで使えます。 😎
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 11.9K bytes
    - Click Count (0)
  5. .github/workflows/arm-ci.yml

          - name: Checkout repository
            uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
          - name: Build binary and run python tests
            shell: bash
            run: |
              CI_DOCKER_BUILD_EXTRA_PARAMS="--pull --build-arg py_major_minor_version=${{ matrix.pyver }} --build-arg is_nightly=1 --build-arg tf_project_name=tf_nightly_ci" \
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Thu Jan 01 08:09:03 GMT 2026
    - 2.2K bytes
    - Click Count (0)
  6. fastapi/security/oauth2.py

        Read more about it in the
        [FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
    
        ## Example
    
        ```python
        from typing import Annotated
    
        from fastapi import Depends, FastAPI
        from fastapi.security import OAuth2PasswordRequestForm
    
        app = FastAPI()
    
    
        @app.post("/login")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Mar 24 16:32:10 GMT 2026
    - 23.6K bytes
    - Click Count (0)
  7. fastapi/param_functions.py

                This will be used to extract the data and for the generated OpenAPI.
                It is particularly useful when you can't use the name you want because it
                is a Python reserved keyword or similar.
                """
            ),
        ] = None,
        alias_priority: Annotated[
            int | None,
            Doc(
                """
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 68K bytes
    - Click Count (0)
  8. ci/official/utilities/convert_msys_paths_to_win_paths.py

        if not value or not should_convert(var,
                                           parsed_args.blacklist,
                                           parsed_args.whitelist_prefix):
          continue
    
        # In Python, MSYS, Linux-like paths are automatically read as Windows paths
        # with forward slashes, e.g. 'C:/Program Files', instead of
        # '/c/Program Files', thus becoming converted simply by virtue of having
        # been read.
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Wed Aug 07 23:01:25 GMT 2024
    - 2.5K bytes
    - Click Count (0)
  9. .github/ISSUE_TEMPLATE/tflite-converter-issue.md

    ```
    
    #### Option B: Paste your code here or provide a link to a custom end-to-end colab
    
    ```
    (You can paste links or attach files by dragging & dropping them below)
    - Include code to invoke the TFLite Converter Python API and the errors.
    - Provide links to your TensorFlow model and (optionally) TensorFlow Lite Model.
    ```
    
    ### 3. Failure after conversion
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Wed Jun 15 03:35:58 GMT 2022
    - 2.1K bytes
    - Click Count (0)
  10. scripts/general-llm-prompt.md

    Examples:
    
    Source (English):
    
    //// tab | Python 3.8+ non-Annotated
    Hello
    ////
    
    Result (German):
    
    //// tab | Python 3.8+ nicht annotiert
    Hallo
    ////
    
    Source (English) - Here there is nothing to translate in the tab title:
    
    //// tab | Linux, macOS, Windows Bash
    Hello again
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Mar 18 10:55:36 GMT 2026
    - 14.6K bytes
    - Click Count (0)
Back to Top