Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 191 for get_db (0.21 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. tests/test_security_scopes.py

    @pytest.fixture(name="app")
    def app_fixture(call_counter: dict[str, int]):
        def get_db():
            call_counter["count"] += 1
            return f"db_{call_counter['count']}"
    
        def get_user(db: Annotated[str, Depends(get_db)]):
            return "user"
    
        app = FastAPI()
    
        @app.get("/")
        def endpoint(
            db: Annotated[str, Depends(get_db)],
            user: Annotated[str, Security(get_user, scopes=["read"])],
        ):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1006 bytes
    - Click Count (0)
  2. docs_src/dependencies/tutorial010_py310.py

        def __init__(self):
            self.db = DBSession()
    
        def __enter__(self):
            return self.db
    
        def __exit__(self, exc_type, exc_value, traceback):
            self.db.close()
    
    
    async def get_db():
        with MySuperContextManager() as db:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 292 bytes
    - Click Count (0)
  3. fastapi/.agents/skills/fastapi/references/dependencies.md

    ```python
    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    def get_db():
        db = DBSession()
        try:
            yield db
        finally:
            db.close()
    
    
    DBDep = Annotated[DBSession, Depends(get_db)]
    
    
    @app.get("/items/")
    async def read_items(db: DBDep):
        return db.query(Item).all()
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  4. docs_src/dependencies/tutorial007_py310.py

    async def get_db():
        db = DBSession()
        try:
            yield db
        finally:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 99 bytes
    - Click Count (0)
  5. src/test/java/jcifs/util/CryptoTest.java

        void testHashVariousInputSizes(String input) {
            // Given
            byte[] data = input.getBytes();
    
            // When
            MessageDigest md4 = Crypto.getMD4();
            MessageDigest md5 = Crypto.getMD5();
            byte[] md4Hash = md4.digest(data);
            byte[] md5Hash = md5.digest(data);
    
            // Then
            assertNotNull(md4Hash);
            assertNotNull(md5Hash);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 7.4K bytes
    - Click Count (0)
  6. compat/maven-compat/src/main/java/org/apache/maven/profiles/activation/JdkPrefixProfileActivator.java

        }
    
        @Override
        protected boolean canDetectActivation(Profile profile) {
            return profile.getActivation() != null
                    && profile.getActivation().getJdk() != null
                    && !profile.getActivation().getJdk().isEmpty();
        }
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Fri Jun 06 14:28:57 GMT 2025
    - 3K bytes
    - Click Count (0)
  7. src/test/java/org/codelibs/core/beans/util/BeanUtilTest.java

            dest.setBbb("bbb");
            dest.setDdd("ddd");
    
            BeanUtil.copyBeanToBean(src, dest);
            assertThat(dest.getAaa(), is("111"));
            assertThat(dest.getBbb(), is(nullValue()));
            assertThat(dest.getDdd(), is("ddd"));
        }
    
        /**
         * @throws Exception
         */
        @Test
        public void testCopy_BeanToBean_ExcludeNull() throws Exception {
            final MyClass src = new MyClass();
    Created: Fri Apr 03 20:58:12 GMT 2026
    - Last Modified: Fri Jun 20 13:40:57 GMT 2025
    - 34.5K bytes
    - Click Count (0)
  8. src/main/java/jcifs/smb/NtlmUtil.java

        public static byte[] getNTHash(final String password) {
            if (password == null) {
                throw new NullPointerException("Password parameter is required");
            }
            final MessageDigest md4 = Crypto.getMD4();
            md4.update(Strings.getUNIBytes(password));
            return md4.digest();
        }
    
        /**
         * Generates the NT password hash for the given password.
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 30 05:58:03 GMT 2025
    - 15.1K bytes
    - Click Count (0)
  9. compat/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java

                    if (!minProfileIds.add(profile.getId())) {
                        addViolation(
                                problems,
                                Severity.WARNING,
                                Version.BASE,
                                "profiles.profile.id",
                                null,
                                "Duplicate activation for profile " + profile.getId(),
                                profile);
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Wed Sep 03 15:06:05 GMT 2025
    - 66.8K bytes
    - Click Count (0)
  10. src/test/java/jcifs/util/HMACT64Test.java

        @Mock
        private MessageDigest mockMd5;
    
        @BeforeEach
        void setUp() throws NoSuchAlgorithmException {
            // Mock Crypto.getMD5() to return our mockMd5 instance
            // This requires Mockito 3.4.0+ for MockedStatic
            // For simplicity, we'll assume Crypto.getMD5() is static and mock it.
            // If it's not static, we'd need to inject it or mock the class that provides it.
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 14.6K bytes
    - Click Count (0)
Back to Top