Search Options

Results per page
Sort
Preferred Languages
Advance

Results 101 - 110 of 3,441 for yield (0.05 sec)

  1. docs_src/dependencies/tutorial008d_an_py39.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException
    
    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
    - 734 bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/tests/tf-ops.mlir

      func.return %1 : tensor<2xf32>
    }
    
    // -----
    
    // Test invalid tf.Yield operation (parent should be IfRegion)
    func.func @testInvalidYieldOp(%arg0: f32) -> () {
      // expected-error @+1 {{'tf.Yield' op expects parent op to be one of 'tf.CaseRegion, tf.IfRegion, tf.WhileRegion, tf.GeneratorDatasetRegion'}}
      "tf.Yield"(%arg0) : (f32) -> ()
    }
    
    // -----
    
    // Test valid tf.IfRegion operation
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Oct 23 14:40:35 UTC 2023
    - 236.4K bytes
    - Viewed (0)
  3. 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)
  4. tensorflow/compiler/mlir/tensorflow/tests/freeze_variables.mlir

        %0 = "tf.IfRegion"(%arg0) ({
          %1 = "tf.ReadVariableOp"(%handle) : (tensor<!tf_type.resource<tensor<0xf32>>>) -> (tensor<0xf32>)
          "tf.Yield"(%1) : (tensor<0xf32>) -> ()
         },  {
          %2 = "tf.Const"() {value = dense<1.0> : tensor<0xf32>} : () -> tensor<0xf32>
          "tf.Yield"(%2) : (tensor<0xf32>) -> ()
        }) {is_stateless = true} : (tensor<i1>) -> (tensor<0xf32>)
        func.return %0 : tensor<0xf32>
      }
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Oct 30 06:52:55 UTC 2023
    - 23.6K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/transforms/tf_passes.td

        "tf.IfRegion"(%0) ( {
          %2 = "tf.A"() : () -> (tensor<f32>)
          "tf.Yield"() : () -> ()
          }, {
          "tf.Yield"() : () -> ()
         }) { is_stateless = true } : (tensor<i1>) -> ()
        "tf.IfRegion"(%0) ( {
          %2 = "tf.B"() : () -> (tensor<f32>)
          "tf.Yield"() : () -> ()
          }, {
          "tf.Yield"() : () -> ()
          }) { is_stateless = true } : (tensor<i1>) -> ()
        ```
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 12 21:18:05 UTC 2024
    - 99.6K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top