Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,377 for isinstance (0.28 sec)

  1. fastapi/dependencies/utils.py

    ) -> Dependant:
        security_requirement = None
        security_scopes = security_scopes or []
        if isinstance(depends, params.Security):
            dependency_scopes = depends.scopes
            security_scopes.extend(dependency_scopes)
        if isinstance(dependency, SecurityBase):
            use_scopes: List[str] = []
            if isinstance(dependency, (OAuth2, OpenIdConnect)):
                use_scopes = security_scopes
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  2. fastapi/encoders.py

                for encoder_type, encoder_instance in custom_encoder.items():
                    if isinstance(obj, encoder_type):
                        return encoder_instance(obj)
        if include is not None and not isinstance(include, (set, dict)):
            include = set(include)
        if exclude is not None and not isinstance(exclude, (set, dict)):
            exclude = set(exclude)
        if isinstance(obj, BaseModel):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  3. fastapi/openapi/utils.py

        callback_flat_models: List[ModelField] = []
        for route in routes:
            if getattr(route, "include_in_schema", None) and isinstance(
                route, routing.APIRoute
            ):
                if route.body_field:
                    assert isinstance(
                        route.body_field, ModelField
                    ), "A request body must be a Pydantic Field"
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  4. scripts/mkdocs_hooks.py

        for item in items:
            if isinstance(item, str):
                resolve_file(item=item, files=files, config=config)
            elif isinstance(item, dict):
                assert len(item) == 1
                values = list(item.values())
                if not values:
                    continue
                if isinstance(values[0], str):
                    resolve_file(item=values[0], files=files, config=config)
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  5. fastapi/utils.py

            if (
                key in main_dict
                and isinstance(main_dict[key], dict)
                and isinstance(value, dict)
            ):
                deep_dict_update(main_dict[key], value)
            elif (
                key in main_dict
                and isinstance(main_dict[key], list)
                and isinstance(update_dict[key], list)
            ):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  6. fastapi/datastructures.py

        @classmethod
        def validate(cls: Type["UploadFile"], v: Any) -> Any:
            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):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  7. src/test/java/org/codelibs/core/lang/GenericsUtilTest.java

            final Type t3 = m3.getGenericReturnType();
            assertThat(GenericsUtil.isTypeOf(t3, Map.class), is(true));
            assertThat(WildcardType.class.isInstance(GenericsUtil.getKeyTypeOfMap(t3)), is(true));
            assertThat(WildcardType.class.isInstance(GenericsUtil.getValueTypeOfMap(t3)), is(true));
        }
    
        /**
         * @throws Exception
         */
        public void testGetTypeVariableMap() throws Exception {
    Java
    - Registered: Fri Apr 26 20:58:09 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 11.5K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/util/concurrent/Platform.java

    @GwtCompatible(emulated = true)
    @ElementTypesAreNonnullByDefault
    final class Platform {
      static boolean isInstanceOfThrowableClass(
          @CheckForNull Throwable t, Class<? extends Throwable> expectedClass) {
        return expectedClass.isInstance(t);
      }
    
      static void restoreInterruptIfIsInterruptedException(Throwable t) {
        checkNotNull(t); // to satisfy NullPointerTester
        if (t instanceof InterruptedException) {
          currentThread().interrupt();
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue May 10 12:27:25 GMT 2022
    - 1.4K bytes
    - Viewed (0)
  9. tests/test_inherited_custom_class.py

        from pydantic import field_serializer
    
        app = FastAPI()
    
        @app.get("/fast_uuid")
        def return_fast_uuid():
            asyncpg_uuid = MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
            assert isinstance(asyncpg_uuid, uuid.UUID)
            assert type(asyncpg_uuid) != uuid.UUID
            with pytest.raises(TypeError):
                vars(asyncpg_uuid)
            return {"fast_uuid": asyncpg_uuid}
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3K bytes
    - Viewed (0)
  10. fastapi/_compat.py

            use_errors: List[Any] = []
            for error in errors:
                if isinstance(error, ErrorWrapper):
                    new_errors = ValidationError(  # type: ignore[call-arg]
                        errors=[error], model=RequestErrorModel
                    ).errors()
                    use_errors.extend(new_errors)
                elif isinstance(error, list):
                    use_errors.extend(_normalize_errors(error))
                else:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
Back to top