Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for replace (0.19 sec)

  1. tests/test_datetime_custom_encoder.py

        class ModelWithDatetimeField(BaseModel):
            dt_field: datetime
    
            @field_serializer("dt_field")
            def serialize_datetime(self, dt_field: datetime):
                return dt_field.replace(microsecond=0, tzinfo=timezone.utc).isoformat()
    
        app = FastAPI()
        model = ModelWithDatetimeField(dt_field=datetime(2019, 1, 1, 8))
    
        @app.get("/model", response_model=ModelWithDatetimeField)
        def get_model():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  2. tests/test_jsonable_encoder.py

        class ModelWithCustomEncoder(BaseModel):
            dt_field: datetime
    
            @field_serializer("dt_field")
            def serialize_dt_field(self, dt):
                return dt.replace(microsecond=0, tzinfo=timezone.utc).isoformat()
    
        class ModelWithCustomEncoderSubclass(ModelWithCustomEncoder):
            pass
    
        model = ModelWithCustomEncoder(dt_field=datetime(2019, 1, 1, 8))
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  3. fastapi/openapi/utils.py

    
    def generate_operation_summary(*, route: routing.APIRoute, method: str) -> str:
        if route.summary:
            return route.summary
        return route.name.replace("_", " ").title()
    
    
    def get_openapi_operation_metadata(
        *, route: routing.APIRoute, method: str, operation_ids: Set[str]
    ) -> Dict[str, Any]:
        operation: Dict[str, Any] = {}
        if route.tags:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  4. fastapi/dependencies/utils.py

                use_annotation,
                field_info,
                param_name,
            )
            if not field_info.alias and getattr(field_info, "convert_underscores", None):
                alias = param_name.replace("_", "-")
            else:
                alias = field_info.alias or param_name
            field_info.alias = alias
            field = create_response_field(
                name=param_name,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  5. fastapi/openapi/docs.py

                if (/code|token|error/.test(window.location.hash)) {
                    qp = window.location.hash.substring(1).replace('?', '&');
                } else {
                    qp = location.search.substring(1);
                }
    
                arr = qp.split("&");
                arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
                qp = qp ? JSON.parse('{' + arr.join() + '}',
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  6. ci/official/wheel_test/test_import_api_packages.py

          # Convert package name to the short version:
          # tensorflow._api.v2.distribute.experimental to
          # tensorflow.distribute.experimental
          short_package_name = package_name.replace(f"_api.{version}.", "")
          # skip non-importable paths
          if short_package_name not in self.packages_for_skip:
            try:
              __import__(short_package_name)
            except ImportError:
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Wed Sep 13 15:52:07 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  7. fastapi/_compat.py

                # Ref: https://github.com/pydantic/pydantic/blob/d61792cc42c80b13b23e3ffa74bc37ec7c77f7d1/pydantic/schema.py#L207
                json_schema["title"] = (
                    field.field_info.title or field.alias.title().replace("_", " ")
                )
            return json_schema
    
        def get_compat_model_name_map(fields: List[ModelField]) -> ModelNameMap:
            return {}
    
        def get_definitions(
            *,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  8. configure.py

      else:
        output = subprocess.check_output(cmd, stderr=stderr)
      return output.decode('UTF-8').strip()
    
    
    def cygpath(path):
      """Convert path from posix to windows."""
      return os.path.abspath(path).replace('\\', '/')
    
    
    def get_python_path(environ_cp, python_bin_path):
      """Get the python site package paths."""
      python_paths = []
      if environ_cp.get('PYTHONPATH'):
    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)
  9. fastapi/applications.py

                name: str
                description: str | None = None
    
            app = FastAPI()
    
            @app.put("/items/{item_id}")
            def replace_item(item_id: str, item: Item):
                return {"message": "Item replaced", "id": item_id}
            ```
            """
            return self.router.put(
                path,
                response_model=response_model,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  10. tensorflow/api_template_v1.__init__.py

    If you depend on functionality not listed there, please file an issue.
    """
    contrib = _LazyLoader("contrib", globals(), "tensorflow.contrib",
                          _CONTRIB_WARNING)
    # The templated code that replaces the placeholder above sometimes
    # sets the __all__ variable. If it does, we have to be sure to add
    # "contrib".
    if "__all__" in vars():
      vars()["__all__"].append("contrib")
    
    from tensorflow.python.platform import flags
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Tue Jan 23 02:14:00 GMT 2024
    - 7.4K bytes
    - Viewed (0)
Back to top