Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for global (0.21 sec)

  1. tests/test_dependency_normal_exceptions.py

    def put_user(user_id: str, name: str = Body(), db: dict = Depends(get_database)):
        db[user_id] = name
        return {"message": "OK"}
    
    
    @pytest.fixture(autouse=True)
    def reset_state_and_db():
        global fake_database
        global state
        fake_database = initial_fake_database.copy()
        state = initial_state.copy()
    
    
    client = TestClient(app)
    
    
    def test_dependency_gets_exception():
        assert state["except"] is False
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  2. docs_src/sql_databases_peewee/sql_app/main.py

        return items
    
    
    @app.get(
        "/slowusers/", response_model=List[schemas.User], dependencies=[Depends(get_db)]
    )
    def read_slow_users(skip: int = 0, limit: int = 100):
        global sleep_time
        sleep_time = max(0, sleep_time - 1)
        time.sleep(sleep_time)  # Fake long processing request
        users = crud.get_users(skip=skip, limit=limit)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 2.2K bytes
    - Viewed (0)
  3. fastapi/dependencies/utils.py

        signature = inspect.signature(call)
        globalns = getattr(call, "__globals__", {})
        typed_params = [
            inspect.Parameter(
                name=param.name,
                kind=param.kind,
                default=param.default,
                annotation=get_typed_annotation(param.annotation, globalns),
            )
            for param in signature.parameters.values()
        ]
    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)
  4. fastapi/openapi/utils.py

            message = (
                f"Duplicate Operation ID {operation_id} for function "
                + f"{route.endpoint.__name__}"
            )
            file_name = getattr(route.endpoint, "__globals__", {}).get("__file__")
            if file_name:
                message += f" at {file_name}"
            warnings.warn(message, stacklevel=1)
        operation_ids.add(operation_id)
        operation["operationId"] = operation_id
    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)
  5. configure.py

        gcc_version = run_shell([gcc_env, '--version']).split()
        if gcc_version[0] in ('gcc', 'g++'):
          return gcc_env
      return None
    
    
    def main():
      global _TF_WORKSPACE_ROOT
      global _TF_BAZELRC
      global _TF_CURRENT_BAZEL_VERSION
    
      parser = argparse.ArgumentParser()
      parser.add_argument(
          '--workspace',
          type=str,
    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)
  6. fastapi/applications.py

                Doc(
                    """
                    A list of global dependencies, they will be applied to each
                    *path operation*, including in sub-routers.
    
                    Read more about it in the
                    [FastAPI docs for Global Dependencies](https://fastapi.tiangolo.com/tutorial/dependencies/global-dependencies/).
    
                    **Example**
    
                    ```python
    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)
  7. tests/test_local_docs.py

    Sebastián Ramírez <******@****.***> 1608490200 +0100
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Dec 20 18:50:00 GMT 2020
    - 2.4K bytes
    - Viewed (0)
  8. tensorflow/api_template_v1.__init__.py

    # Lazy-load Keras v1.
    _tf_uses_legacy_keras = (
        _os.environ.get("TF_USE_LEGACY_KERAS", None) in ("true", "True", "1"))
    setattr(_current_module, "keras", _KerasLazyLoader(globals(), mode="v1"))
    _module_dir = _module_util.get_parent_dir_for_name("keras._tf_keras.keras")
    _current_module.__path__ = [_module_dir] + _current_module.__path__
    if _tf_uses_legacy_keras:
    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)
  9. tensorflow/api_template.__init__.py

      )
    
    # Add Keras module aliases
    _losses = _KerasLazyLoader(globals(), submodule="losses", name="losses")
    _metrics = _KerasLazyLoader(globals(), submodule="metrics", name="metrics")
    _optimizers = _KerasLazyLoader(
        globals(), submodule="optimizers", name="optimizers")
    _initializers = _KerasLazyLoader(
        globals(), submodule="initializers", name="initializers")
    setattr(_current_module, "losses", _losses)
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Tue Mar 05 06:27:59 GMT 2024
    - 6.7K bytes
    - Viewed (3)
  10. ci/official/wheel_test/test_import_api_packages.py

    """Import API packages test.
    
    This is a Python test that verifies whether API v2 packages can be imported
    from the current build or not.
    
    It uses the `_api/v2/api_packages.txt` file from the local wheel file.
    The `_api/v2/api_packages.txt` file is created during the process of generating
    TensorFlow API v2 init files and is stored in the wheel file after the build.
    
    See README.md file for "how to run" instruction.
    """
    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)
Back to top