Search Options

Results per page
Sort
Preferred Languages
Advance

Results 471 - 480 of 1,074 for Str (0.02 sec)

  1. docs/ru/docs/tutorial/path-params.md

    ### Создание класса `Enum`
    
    Импортируйте `Enum` и создайте подкласс, который наследуется от `str` и `Enum`.
    
    Мы наследуемся от `str`, чтобы документация API могла понять, что значения должны быть типа `string` и отображалась правильно.
    
    Затем создайте атрибуты класса с фиксированными допустимыми значениями:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  2. docs_src/sql_databases/tutorial001_an.py

    from typing_extensions import Annotated
    
    
    class Hero(SQLModel, table=True):
        id: Union[int, None] = Field(default=None, primary_key=True)
        name: str = Field(index=True)
        age: Union[int, None] = Field(default=None, index=True)
        secret_name: str
    
    
    sqlite_file_name = "database.db"
    sqlite_url = f"sqlite:///{sqlite_file_name}"
    
    connect_args = {"check_same_thread": False}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  3. tests/test_security_openid_connect_optional.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    oid = OpenIdConnect(openIdConnectUrl="/openid", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(oid)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  4. src/main/java/jcifs/smb1/smb1/Trans2FindFirst2Response.java

            subCommand = SmbComTransaction.TRANS2_FIND_FIRST2;
        }
    
        String readString( byte[] src, int srcIndex, int len ) {
            String str = null;
            try {
                if( useUnicode ) {
                    // should Unicode alignment be corrected for here?
                    str = new String( src, srcIndex, len, UNI_ENCODING );
                } else {
        
                    /* On NT without Unicode the fileNameLength
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Fri Mar 22 21:10:40 UTC 2019
    - 8.5K bytes
    - Viewed (0)
  5. tests/test_additional_responses_response_class.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class JsonApiResponse(JSONResponse):
        media_type = "application/vnd.api+json"
    
    
    class Error(BaseModel):
        status: str
        title: str
    
    
    class JsonApiError(BaseModel):
        errors: typing.List[Error]
    
    
    @app.get(
        "/a",
        response_class=JsonApiResponse,
        responses={500: {"description": "Error", "model": JsonApiError}},
    )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  6. docs_src/sql_databases/tutorial001_py39.py

    from sqlmodel import Field, Session, SQLModel, create_engine, select
    
    
    class Hero(SQLModel, table=True):
        id: Union[int, None] = Field(default=None, primary_key=True)
        name: str = Field(index=True)
        age: Union[int, None] = Field(default=None, index=True)
        secret_name: str
    
    
    sqlite_file_name = "database.db"
    sqlite_url = f"sqlite:///{sqlite_file_name}"
    
    connect_args = {"check_same_thread": False}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/ImmutableListMultimap.java

       *
       * <pre>{@code
       * static final Multimap<Character, String> FIRST_LETTER_MULTIMAP =
       *     Stream.of("banana", "apple", "carrot", "asparagus", "cherry")
       *         .collect(toImmutableListMultimap(str -> str.charAt(0), str -> str.substring(1)));
       *
       * // is equivalent to
       *
       * static final Multimap<Character, String> FIRST_LETTER_MULTIMAP =
       *     new ImmutableListMultimap.Builder<Character, String>()
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Aug 16 20:20:32 UTC 2024
    - 19K bytes
    - Viewed (0)
  8. docs/zh/docs/tutorial/security/get-current-user.md

    `get_current_user` 使用 `oauth2_scheme` 作为依赖项。
    
    与之前直接在路径操作中的做法相同,新的 `get_current_user` 依赖项从子依赖项 `oauth2_scheme` 中接收 `str` 类型的 `token`:
    
    ```Python hl_lines="25"
    {!../../docs_src/security/tutorial002.py!}
    ```
    
    ## 获取用户
    
    `get_current_user` 使用创建的(伪)工具函数,该函数接收 `str` 类型的令牌,并返回 Pydantic 的 `User` 模型:
    
    ```Python hl_lines="19-22  26-27"
    {!../../docs_src/security/tutorial002.py!}
    ```
    
    ## 注入当前用户
    
    在*路径操作* 的 `Depends` 中使用 `get_current_user`:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  9. guava/src/com/google/common/io/CharStreams.java

          checkPositionIndexes(off, off + len, cbuf.length);
        }
    
        @Override
        public void write(String str) {
          checkNotNull(str);
        }
    
        @Override
        public void write(String str, int off, int len) {
          checkPositionIndexes(off, off + len, str.length());
        }
    
        @Override
        public Writer append(@CheckForNull CharSequence csq) {
          return this;
        }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed May 17 14:35:11 UTC 2023
    - 10.9K bytes
    - Viewed (0)
  10. ci/official/utilities/extract_resultstore_links.py

    form of JUnit-based XML.
    """
    import argparse
    import datetime
    import os
    import re
    from typing import Dict, Union
    import xml.etree.ElementTree as ElemTree
    
    
    ResultDictType = Dict[str, Dict[str, Union[str, int]]]
    
    RESULT_STORE_LINK_RE = re.compile(
        r'^INFO: Streaming build results to: (https://[\w./\-]+)')
    FAILED_BUILD_LINE = 'FAILED: Build did NOT complete successfully'
    BUILD_STATUS_LINE = 'INFO: Build'
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Wed Nov 08 17:50:27 UTC 2023
    - 10.9K bytes
    - Viewed (0)
Back to top