Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 35 for __name__ (0.06 seconds)

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

  1. docs/zh-hant/docs/tutorial/debugging.md

    你可以在編輯器中連接偵錯器,例如 Visual Studio Code 或 PyCharm。
    
    ## 呼叫 `uvicorn` { #call-uvicorn }
    
    在你的 FastAPI 應用程式中,直接匯入並執行 `uvicorn`:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### 關於 `__name__ == "__main__"` { #about-name-main }
    
    `__name__ == "__main__"` 的主要目的是,當你的檔案以以下方式呼叫時,執行某些程式碼:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    但當其他檔案匯入它時不會執行,例如:
    
    ```Python
    from myapp import app
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  2. docs/ko/docs/tutorial/debugging.md

    ## `uvicorn` 호출 { #call-uvicorn }
    
    FastAPI 애플리케이션에서 `uvicorn`을 직접 임포트하여 실행합니다:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### `__name__ == "__main__"` 에 대하여 { #about-name-main }
    
    `__name__ == "__main__"`의 주요 목적은 다음과 같이 파일이 호출될 때 실행되는 일부 코드를 갖는 것입니다.
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    그러나 다음과 같이 다른 파일을 가져올 때는 호출되지 않습니다.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 2.8K bytes
    - Click Count (0)
  3. docs/sts/web-identity.py

    client_secret = 'daaa3008-80f0-40f7-80d7-e15167531ff0'
    
    sts_client = boto3.client(
        'sts',
        region_name='us-east-1',
        use_ssl=False,
        endpoint_url='http://localhost:9000',
    )
    
    app = Flask(__name__)
    
    
    @app.route('/')
    def homepage():
        text = '<a href="%s">Authenticate with keycloak</a>'
        return text % make_authorization_url()
    
    
    def make_authorization_url():
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Wed Jul 28 01:37:51 GMT 2021
    - 2.9K bytes
    - Click Count (0)
  4. tensorflow/api_template.__init__.py

    # the __path__ so that "from tensorflow.foo import bar" works.
    # We're using bitwise, but there's nothing special about that.
    _API_MODULE = _sys.modules[__name__].bitwise
    _tf_api_dir = _os.path.dirname(_os.path.dirname(_API_MODULE.__file__))
    _current_module = _sys.modules[__name__]
    
    if not hasattr(_current_module, "__path__"):
      __path__ = [_tf_api_dir]
    elif _tf_api_dir not in __path__:
      __path__.append(_tf_api_dir)
    
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Wed Oct 02 22:16:02 GMT 2024
    - 6.8K bytes
    - Click Count (0)
  5. docs_src/wsgi/tutorial001_py310.py

    from a2wsgi import WSGIMiddleware
    from fastapi import FastAPI
    from flask import Flask, request
    from markupsafe import escape
    
    flask_app = Flask(__name__)
    
    
    @flask_app.route("/")
    def flask_main():
        name = request.args.get("name", "World")
        return f"Hello, {escape(name)} from Flask!"
    
    
    app = FastAPI()
    
    
    @app.get("/v2")
    def read_main():
        return {"message": "Hello World"}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 426 bytes
    - Click Count (0)
  6. docs/lambda/README.md

    Install the necessary dependencies.
    ```sh
    pip install flask requests
    ```
    
    Following is an example lambda handler.
    ```py
    from flask import Flask, request, abort, make_response
    import requests
    
    app = Flask(__name__)
    @app.route('/', methods=['POST'])
    def get_webhook():
    	if request.method == 'POST':
    		# obtain the request event from the 'POST' call
    		event = request.json
    
    		object_context = event["getObjectContext"]
    
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Tue Aug 12 18:20:36 GMT 2025
    - 7.7K bytes
    - Click Count (0)
  7. ci/official/utilities/rename_and_verify_wheels.sh

      "$python" -c 'import tensorflow as tf; t1=tf.constant([1,2,3,4]); t2=tf.constant([5,6,7,8]); print(tf.add(t1,t2).shape)'
      "$python" -c 'import sys; import tensorflow as tf; sys.exit(0 if "keras" in tf.keras.__name__ else 1)'
    fi
    # Import tf nightly wheel built with numpy2 from PyPI in numpy1 env for testing.
    # This aims to maintain TF compatibility with NumPy 1.x until 2025 b/361369076.
    if [[ "$TFCI_WHL_NUMPY_VERSION" == 1 ]]; then
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Mon Sep 22 21:39:32 GMT 2025
    - 4.4K bytes
    - Click Count (0)
  8. tensorflow/api_template_v1.__init__.py

    # the __path__ so that "from tensorflow.foo import bar" works.
    # We're using bitwise, but there's nothing special about that.
    _API_MODULE = _sys.modules[__name__].bitwise  # pylint: disable=undefined-variable
    _current_module = _sys.modules[__name__]
    _tf_api_dir = _os.path.dirname(_os.path.dirname(_API_MODULE.__file__))
    if not hasattr(_current_module, "__path__"):
      __path__ = [_tf_api_dir]
    elif _tf_api_dir not in __path__:
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Wed Oct 02 22:16:02 GMT 2024
    - 7.5K bytes
    - Click Count (0)
  9. fastapi/_compat/v2.py

            ModelField(
                field_info=FieldInfo(annotation=model),
                name=model.__name__,
                mode="validation",
            )
            for model in flat_validation_models
        ]
        flat_serialization_model_fields = [
            ModelField(
                field_info=FieldInfo(annotation=model),
                name=model.__name__,
                mode="serialization",
            )
            for model in flat_serialization_models
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 16.7K bytes
    - Click Count (0)
  10. scripts/sponsors.py

        logging.info("Creating PR")
        pr = repo.create_pull(title=message, body=message, base="master", head=branch_name)
        logging.info(f"Created PR: {pr.number}")
        logging.info("Finished")
    
    
    if __name__ == "__main__":
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Dec 16 12:34:01 GMT 2025
    - 6.1K bytes
    - Click Count (0)
Back to Top