Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 1,590 for yield (0.04 sec)

  1. docs_src/dependencies/tutorial008b_an_py39.py

        "portal-gun": {"description": "Gun to create portals", "owner": "Rick"},
    }
    
    
    class OwnerError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except OwnerError as e:
            raise HTTPException(status_code=400, detail=f"Owner error: {e}")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Dec 26 20:37:34 UTC 2023
    - 775 bytes
    - Viewed (0)
  2. docs_src/dependencies/tutorial008b.py

        "portal-gun": {"description": "Gun to create portals", "owner": "Rick"},
    }
    
    
    class OwnerError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except OwnerError as e:
            raise HTTPException(status_code=400, detail=f"Owner error: {e}")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Dec 26 20:37:34 UTC 2023
    - 735 bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial008d_an.py

    from fastapi import Depends, FastAPI, HTTPException
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again 😎")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 744 bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008b_an.py

        "portal-gun": {"description": "Gun to create portals", "owner": "Rick"},
    }
    
    
    class OwnerError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except OwnerError as e:
            raise HTTPException(status_code=400, detail=f"Owner error: {e}")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Dec 26 20:37:34 UTC 2023
    - 785 bytes
    - Viewed (0)
  5. docs_src/sql_databases/sql_app/tests/test_sql_app.py

    )
    TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
    
    
    Base.metadata.create_all(bind=engine)
    
    
    def override_get_db():
        try:
            db = TestingSessionLocal()
            yield db
        finally:
            db.close()
    
    
    app.dependency_overrides[get_db] = override_get_db
    
    client = TestClient(app)
    
    
    def test_create_user():
        response = client.post(
            "/users/",
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Jun 22 11:20:12 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/FakeRoutePlanner.kt

        }
        val result = plans[nextPlanIndex++]
        events += "take plan ${result.id}"
    
        if (result.yieldBeforePlanReturns) {
          taskFaker.yield()
        }
    
        val planningThrowable = result.planningThrowable
        if (planningThrowable != null) throw planningThrowable
    
        return result
      }
    
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Wed Apr 24 04:40:49 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/remove_unused_while_results.cc

      if (!result.use_empty()) return false;
    
      Block& body_block = while_op.getBody().front();
      Block& cond_block = while_op.getCond().front();
      Operation* body_yield_op = body_block.getTerminator();
    
      // The body yield operand, body block argument, condition block argument, and
      // result all correspond to each other (see definition of `WhileRegionOp`).
      int idx = result.getResultNumber();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Nov 16 01:49:07 UTC 2022
    - 5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_events/test_tutorial002.py

    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="app", scope="module")
    def get_app():
        with pytest.warns(DeprecationWarning):
            from docs_src.events.tutorial002 import app
        yield app
    
    
    def test_events(app: FastAPI):
        with TestClient(app) as client:
            response = client.get("/items/")
            assert response.status_code == 200, response.text
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Oct 18 12:36:40 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  9. analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirResolveExtensionInfoProvider.kt

                    val declarationName = declaration.nameAsName ?: continue
                    if (!nameFilter(declarationName)) continue
                    with(analysisSession) {
                        yield(declaration.getSymbol() as S)
                    }
                }
            }
        }
    
        override fun getConstructors(): Sequence<KaConstructorSymbol> = withValidityAssertion {
            emptySequence()
        }
    
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Wed May 22 06:28:34 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/executor_tpuv1_outline_tpu_island.cc

        SmallVector<Type, 16> func_operand_types;
        func_operand_types.reserve(operands.size());
        for (Value operand : operands)
          func_operand_types.push_back(operand.getType());
    
        // Function results are the yield operands
        SmallVector<Type, 16> func_result_types;
        for (Value operand : island_op.GetYield().getOperands())
          func_result_types.push_back(operand.getType());
        FunctionType func_type =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.7K bytes
    - Viewed (0)
Back to top