Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for ValueError (0.19 sec)

  1. tests/test_filter_pydantic_sub_model_pv2.py

            foo: ModelB
    
            @field_validator("name")
            def lower_username(cls, name: str, info: ValidationInfo):
                if not name.endswith("A"):
                    raise ValueError("name must end in A")
                return name
    
        async def get_model_c() -> ModelC:
            return ModelC(username="test-user", password="test-password")
    
        @app.get("/model/{name}", response_model=ModelA)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  2. fastapi/datastructures.py

            if not isinstance(v, StarletteUploadFile):
                raise ValueError(f"Expected UploadFile, received: {type(v)}")
            return v
    
        @classmethod
        def _validate(cls, __input_value: Any, _: Any) -> "UploadFile":
            if not isinstance(__input_value, StarletteUploadFile):
                raise ValueError(f"Expected UploadFile, received: {type(__input_value)}")
            return cast(UploadFile, __input_value)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  3. tests/test_jsonable_encoder.py

        assert jsonable_encoder(item, exclude={}) == {"name": "foo", "count": 100}
    
    
    def test_encode_unsupported():
        unserializable = Unserializable()
        with pytest.raises(ValueError):
            jsonable_encoder(unserializable)
    
    
    @needs_pydanticv2
    def test_encode_custom_json_encoders_model_pydanticv2():
        from pydantic import field_serializer
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  4. fastapi/security/http.py

                detail="Invalid authentication credentials",
                headers=unauthorized_headers,
            )
            try:
                data = b64decode(param).decode("ascii")
            except (ValueError, UnicodeDecodeError, binascii.Error):
                raise invalid_user_credentials_exc  # noqa: B904
            username, separator, password = data.partition(":")
            if not separator:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  5. fastapi/encoders.py

        except Exception as e:
            errors: List[Exception] = []
            errors.append(e)
            try:
                data = vars(obj)
            except Exception as e:
                errors.append(e)
                raise ValueError(errors) from e
        return jsonable_encoder(
            data,
            include=include,
            exclude=exclude,
            by_alias=by_alias,
            exclude_unset=exclude_unset,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  6. configure.py

      environ_cp['TF_CUDNN_VERSION'] = tf_cudnn_version
    
    
    def set_tf_tensorrt_version(environ_cp):
      """Set TF_TENSORRT_VERSION."""
      if not (is_linux() or is_windows()):
        raise ValueError('Currently TensorRT is only supported on Linux platform.')
    
      if not int(environ_cp.get('TF_NEED_TENSORRT', False)):
        return
    
      ask_tensorrt_version = (
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 18:25:36 GMT 2024
    - 53.8K bytes
    - Viewed (0)
  7. RELEASE.md

        *   Add a Nearest Neighbor Resize op.
        *   Add an `ignore_unknown` argument to `parse_values` which suppresses
            ValueError for unknown hyperparameter types. Such * Add
            `tf.linalg.matvec` convenience function.
        *   `tf.einsum()`raises `ValueError` for unsupported equations like
            `"ii->"`.
        *   Add DCT-I and IDCT-I in `tf.signal.dct` and `tf.signal.idct`.
        *   Add LU decomposition op.
    Plain Text
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Apr 29 19:17:57 GMT 2024
    - 727.7K bytes
    - Viewed (8)
Back to top