Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 94 for float (0.52 sec)

  1. tests/main.py

    def get_path_param_gt(item_id: float = Path(gt=3)):
        return item_id
    
    
    @app.get("/path/param-gt0/{item_id}")
    def get_path_param_gt0(item_id: float = Path(gt=0)):
        return item_id
    
    
    @app.get("/path/param-ge/{item_id}")
    def get_path_param_ge(item_id: float = Path(ge=3)):
        return item_id
    
    
    @app.get("/path/param-lt/{item_id}")
    def get_path_param_lt(item_id: float = Path(lt=3)):
        return item_id
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  2. tensorflow/c/c_api_test.cc

    TEST(CAPI, TestFromProto) {
      Tensor t_cc(DT_FLOAT, TensorShape({2, 3}));
      t_cc.flat<float>().setConstant(1.0);
      tensorflow::TensorProto t_proto;
      t_cc.AsProtoField(&t_proto);
    
      TF_Buffer* t_buffer = TF_NewBuffer();
      TF_CHECK_OK(MessageToBuffer(t_proto, t_buffer));
    
      const int num_bytes = 6 * sizeof(float);
      float* values =
          reinterpret_cast<float*>(tensorflow::cpu_allocator()->AllocateRaw(
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 96.9K bytes
    - Viewed (3)
  3. fastapi/params.py

            serialization_alias: Union[str, None] = None,
            title: Optional[str] = None,
            description: Optional[str] = None,
            gt: Optional[float] = None,
            ge: Optional[float] = None,
            lt: Optional[float] = None,
            le: Optional[float] = None,
            min_length: Optional[int] = None,
            max_length: Optional[int] = None,
            pattern: Optional[str] = None,
            regex: Annotated[
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  4. fastapi/param_functions.py

                """
            ),
        ] = None,
        gt: Annotated[
            Optional[float],
            Doc(
                """
                Greater than. If set, value must be greater than this. Only applicable to
                numbers.
                """
            ),
        ] = None,
        ge: Annotated[
            Optional[float],
            Doc(
                """
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_dataclasses/test_tutorial001.py

            # TODO: remove when deprecating Pydantic v1
            {
                "detail": [
                    {
                        "loc": ["body", "price"],
                        "msg": "value is not a valid float",
                        "type": "type_error.float",
                    }
                ]
            }
        )
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  6. fastapi/encoders.py

    # TODO: pv2 should this return strings instead?
    def decimal_encoder(dec_value: Decimal) -> Union[int, float]:
        """
        Encodes a Decimal as int of there's no exponent, otherwise float
    
        This is useful when we use ConstrainedDecimal to represent Numeric(x,0)
        where a integer (but not int typed) is used. Encoding this as a float
        results in failed round-tripping between encode and parse.
        Our Id type is a prime example of this.
    
    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)
  7. tests/test_path.py

                        "msg": "value is not a valid float",
                        "type": "type_error.float",
                    }
                ]
            }
        )
    
    
    def test_path_float_42():
        response = client.get("/path/float/42")
        assert response.status_code == 200
        assert response.json() == 42
    
    
    def test_path_float_42_5():
        response = client.get("/path/float/42.5")
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 34.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body/test_tutorial001_py310.py

        return client
    
    
    @needs_py310
    def test_body_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    @needs_py310
    def test_post_with_str_float(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15K bytes
    - Viewed (1)
  9. tests/test_tutorial/test_body/test_tutorial001.py

        return client
    
    
    def test_body_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    def test_post_with_str_float(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 14.7K bytes
    - Viewed (5)
  10. fastapi/openapi/models.py

        type: Optional[str] = None
        enum: Optional[List[Any]] = None
        const: Optional[Any] = None
        multipleOf: Optional[float] = Field(default=None, gt=0)
        maximum: Optional[float] = None
        exclusiveMaximum: Optional[float] = None
        minimum: Optional[float] = None
        exclusiveMinimum: Optional[float] = None
        maxLength: Optional[int] = Field(default=None, ge=0)
        minLength: Optional[int] = Field(default=None, ge=0)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 22:49:33 GMT 2024
    - 15K bytes
    - Viewed (0)
Back to top