-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresults.json
More file actions
1 lines (1 loc) · 42.6 KB
/
Copy pathresults.json
File metadata and controls
1 lines (1 loc) · 42.6 KB
1
[{"regions": {"file1": " object. It is passed the name of the module or package of the\n application. Once it is created it will act as a central registry for\n the view functions, the URL rules, template configuration and much more.\n\n The name of the package is used to resolve resources from inside the\n package or the folder the module is contained in depending on if the\n package parameter resolves to an actual python package (a folder with\n an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file).\n\n For more information about resource loading, see :func:`open_resource`.\n\n Usually you create a :class:`Flask` instance in your main module or\n in the :file:`__init__.py` file of your package like this::\n\n from flask import Flask\n app = Flask(__name__)\n\n .. admonition:: About the First Parameter\n\n The idea of the first parameter is to give Flask an idea of what\n belongs to your application. This name is used to find resources\n on the filesystem, can be used by extensions to improve debugging\n information and a lot more.\n\n So it's important what you provide there. If you are using a single\n module, `__name__` is always the correct value. If you however are\n using a package, it's usually recommended to hardcode the name of\n your package there.\n\n For example if your application is defined in :file:`yourapplication/app.py`\n you should create it with one of the two versions below::\n\n app = Flask('yourapplication')\n app = Flask(__name__.split('.')[0])\n\n Why is that? The application will work even with `__name__`, thanks\n to how resources are looked up. However it will make debugging more\n painful. Certain extensions can make assumptions based on the\n import name of your application. For example the Flask-SQLAlchemy\n extension will look for the code in your application that triggered\n an SQL query in debug mode. If the import name is not properly set\n up, that debugging information is lost. (For example it would only\n pick up SQL queries in `yourapplication.app` and not\n `yourapplication.views.frontend`)\n\n .. versionadded:: 0.7\n The `static_url_path`, `static_folder`, and `template_folder`\n parameters were added.\n\n .. versionadded:: 0.8\n The `instance_path` and `instance_relative_config` parameters were\n added.\n\n .. versionadded:: 0.11\n The `root_path` parameter was added.\n\n .. versionadded:: 1.0\n The ``host_matching`` and ``static_host`` parameters were added.\n\n .. versionadded:: 1.0\n The ``subdomain_matching`` parameter was added. Subdomain\n matching needs to be enabled manually now. Setting\n :data:`SERVER_NAME` does not implicitly enable it.\n\n :param import_name: the name of the application package\n :param static_url_path: can be used to specify a different path for the\n static files on the web. Defaults to the name\n of the `static_folder` folder.\n :param static_folder: The folder with static files that is served at\n ``static_url_path``. Relative to the application ``root_path``\n or an absolute path. Defaults to ``'static'``.\n :param static_host: the host to use when adding the static route.\n Defaults to None. Required when using ``host_matching=True``\n with a ``static_folder`` configured.\n :param host_matching: set ``url_map.host_matching`` attribute.\n Defaults to False.\n :param subdomain_matching: consider the subdomain relative to\n :data:`SERVER_NAME` when matching routes. Defaults to False.\n :param template_folder: the folder that contains the templates that should\n be used by the application. Defaults to\n ``'templates'`` folder in the root path of the\n application.\n :param instance_path: An alternative instance path for the application.\n By default the folder ``'instance'`` next to the\n package or module is assumed to be the instance\n path.\n :param instance_relative_config: if set to ``True`` relative filenames\n for loading the config are assumed to\n be relative to the instance path instead\n of the application root.\n :param root_path: The path to the root of the application files.\n This should only be set manually when it can't be detected\n automatically, such as for namespace packages.\n", "file2": " object. It is passed the name of the module or package of the\n application. Once it is created it will act as a central registry for\n the view functions, the URL rules, template configuration and much more.\n\n The name of the package is used to resolve resources from inside the\n package or the folder the module is contained in depending on if the\n package parameter resolves to an actual python package (a folder with\n an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file).\n\n For more information about resource loading, see :func:`open_resource`.\n\n Usually you create a :class:`Flask` instance in your main module or\n in the :file:`__init__.py` file of your package like this::\n\n from flask import Flask\n app = Flask(__name__)\n\n .. admonition:: About the First Parameter\n\n The idea of the first parameter is to give Flask an idea of what\n belongs to your application. This name is used to find resources\n on the filesystem, can be used by extensions to improve debugging\n information and a lot more.\n\n So it's important what you provide there. If you are using a single\n module, `__name__` is always the correct value. If you however are\n using a package, it's usually recommended to hardcode the name of\n your package there.\n\n For example if your application is defined in :file:`yourapplication/app.py`\n you should create it with one of the two versions below::\n\n app = Flask('yourapplication')\n app = Flask(__name__.split('.')[0])\n\n Why is that? The application will work even with `__name__`, thanks\n to how resources are looked up. However it will make debugging more\n painful. Certain extensions can make assumptions based on the\n import name of your application. For example the Flask-SQLAlchemy\n extension will look for the code in your application that triggered\n an SQL query in debug mode. If the import name is not properly set\n up, that debugging information is lost. (For example it would only\n pick up SQL queries in `yourapplication.app` and not\n `yourapplication.views.frontend`)\n\n .. versionadded:: 0.7\n The `static_url_path`, `static_folder`, and `template_folder`\n parameters were added.\n\n .. versionadded:: 0.8\n The `instance_path` and `instance_relative_config` parameters were\n added.\n\n .. versionadded:: 0.11\n The `root_path` parameter was added.\n\n .. versionadded:: 1.0\n The ``host_matching`` and ``static_host`` parameters were added.\n\n .. versionadded:: 1.0\n The ``subdomain_matching`` parameter was added. Subdomain\n matching needs to be enabled manually now. Setting\n :data:`SERVER_NAME` does not implicitly enable it.\n\n :param import_name: the name of the application package\n :param static_url_path: can be used to specify a different path for the\n static files on the web. Defaults to the name\n of the `static_folder` folder.\n :param static_folder: The folder with static files that is served at\n ``static_url_path``. Relative to the application ``root_path``\n or an absolute path. Defaults to ``'static'``.\n :param static_host: the host to use when adding the static route.\n Defaults to None. Required when using ``host_matching=True``\n with a ``static_folder`` configured.\n :param host_matching: set ``url_map.host_matching`` attribute.\n Defaults to False.\n :param subdomain_matching: consider the subdomain relative to\n :data:`SERVER_NAME` when matching routes. Defaults to False.\n :param template_folder: the folder that contains the templates that should\n be used by the application. Defaults to\n ``'templates'`` folder in the root path of the\n application.\n :param instance_path: An alternative instance path for the application.\n By default the folder ``'instance'`` next to the\n package or module is assumed to be the instance\n path.\n :param instance_relative_config: if set to ``True`` relative filenames\n for loading the config are assumed to\n be relative to the instance path instead\n of the application root.\n :param root_path: The path to the root of the application files.\n This should only be set manually when it can't be detected\n automatically, such as for namespace packages.\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\app.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\sansio\\app.py"}, {"regions": {"file1": " def get_send_file_max_age(self, filename: str | None) -> int | None:\n \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache\n value for a given file path if it wasn't passed.\n\n By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from\n the configuration of :data:`~flask.current_app`. This defaults\n to ``None``, which tells the browser to use conditional requests\n instead of a timed cache, which is usually preferable.\n\n Note this is a duplicate of the same method in the Flask\n class.\n\n .. versionchanged:: 2.0\n The default configuration is ``None`` instead of 12 hours.\n\n .. versionadded:: 0.9\n \"\"\"\n value = current_app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]\n\n if value is None:\n return None\n\n if isinstance(value, timedelta):\n return int(value.total_seconds())\n\n return value # type: ignore[no-any-return]\n\n def send_static_file(self, filename: str) -> Response:\n \"\"\"The view function used to serve files from\n :attr:`static_folder`. A route is automatically registered for\n this view at :attr:`static_url_path` if :attr:`static_folder` is\n set.\n\n Note this is a duplicate of the same method in the Flask\n class.\n\n .. versionadded:: 0.5\n\n \"\"\"\n if not self.has_static_folder:\n raise RuntimeError(\"'static_folder' must be set to serve static_files.\")\n\n # send_file only knows to call get_send_file_max_age on the app,\n # call it here so it works for blueprints too.\n max_age = self.get_send_file_max_age(filename)\n return send_from_directory(\n t.cast(str, self.static_folder), filename, max_age=max_age\n )\n\n def open_resource(\n self, resource: str, mode: str = \"rb\", encoding: str | None = None\n ) -> t.IO[t.AnyStr]:\n", "file2": " def get_send_file_max_age(self, filename: str | None) -> int | None:\n \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache\n value for a given file path if it wasn't passed.\n\n By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from\n the configuration of :data:`~flask.current_app`. This defaults\n to ``None``, which tells the browser to use conditional requests\n instead of a timed cache, which is usually preferable.\n\n Note this is a duplicate of the same method in the Flask\n class.\n\n .. versionchanged:: 2.0\n The default configuration is ``None`` instead of 12 hours.\n\n .. versionadded:: 0.9\n \"\"\"\n value = current_app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]\n\n if value is None:\n return None\n\n if isinstance(value, timedelta):\n return int(value.total_seconds())\n\n return value # type: ignore[no-any-return]\n\n def send_static_file(self, filename: str) -> Response:\n \"\"\"The view function used to serve files from\n :attr:`static_folder`. A route is automatically registered for\n this view at :attr:`static_url_path` if :attr:`static_folder` is\n set.\n\n Note this is a duplicate of the same method in the Flask\n class.\n\n .. versionadded:: 0.5\n\n \"\"\"\n if not self.has_static_folder:\n raise RuntimeError(\"'static_folder' must be set to serve static_files.\")\n\n # send_file only knows to call get_send_file_max_age on the app,\n # call it here so it works for blueprints too.\n max_age = self.get_send_file_max_age(filename)\n return send_from_directory(\n t.cast(str, self.static_folder), filename, max_age=max_age\n )\n\n def open_resource(\n self, resource: str, mode: str = \"rb\", encoding: str | None = \"utf-8\"\n ) -> t.IO[t.AnyStr]:\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\app.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\blueprints.py"}, {"regions": {"file1": "Copyright 2010 Pallets\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n", "file2": "Copyright 2010 Pallets\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\LICENSE.txt", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\javascript\\LICENSE.txt"}, {"regions": {"file1": "Copyright 2010 Pallets\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n", "file2": "Copyright 2010 Pallets\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\LICENSE.txt", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\tutorial\\LICENSE.txt"}, {"regions": {"file1": "Copyright 2010 Pallets\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n", "file2": "Copyright 2010 Pallets\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\tutorial\\LICENSE.txt", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\javascript\\LICENSE.txt"}, {"regions": {"file1": "Domain Name\n-----------\n\nAcquiring and configuring a domain name is outside the scope of this\ndoc. In general, you will buy a domain name from a registrar, pay for\nserver space with a hosting provider, and then point your registrar\nat the hosting provider's name servers.\n\nTo simulate this, you can also edit your ``hosts`` file, located at\n``/etc/hosts`` on Linux. Add a line that associates a name with the\nlocal IP.\n\nModern Linux systems may be configured to treat any domain name that\nends with ``.localhost`` like this without adding it to the ``hosts``\nfile.\n\n.. code-block:: python\n :caption: ``/etc/hosts``\n\n 127.0.0.1 hello.localhost\n\n\nConfiguration\n-------------\n", "file2": "Domain Name\n-----------\n\nAcquiring and configuring a domain name is outside the scope of this\ndoc. In general, you will buy a domain name from a registrar, pay for\nserver space with a hosting provider, and then point your registrar\nat the hosting provider's name servers.\n\nTo simulate this, you can also edit your ``hosts`` file, located at\n``/etc/hosts`` on Linux. Add a line that associates a name with the\nlocal IP.\n\nModern Linux systems may be configured to treat any domain name that\nends with ``.localhost`` like this without adding it to the ``hosts``\nfile.\n\n.. code-block:: python\n :caption: ``/etc/hosts``\n\n 127.0.0.1 hello.localhost\n\n\nConfiguration\n-------------\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\deploying\\apache-httpd.rst", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\deploying\\nginx.rst"}, {"regions": {"file1": "if t.TYPE_CHECKING: # pragma: no cover\n from _typeshed.wsgi import StartResponse\n from _typeshed.wsgi import WSGIEnvironment\n\n from .testing import FlaskClient\n from .testing import FlaskCliRunner\n from .typing import HeadersValue\n\nT_shell_context_processor = t.TypeVar(\n \"T_shell_context_processor\", bound=ft.ShellContextProcessorCallable\n)\nT_teardown = t.TypeVar(\"T_teardown\", bound=ft.TeardownCallable)\nT_template_filter = t.TypeVar(\"T_template_filter\", bound=ft.TemplateFilterCallable)\nT_template_global = t.TypeVar(\"T_template_global\", bound=ft.TemplateGlobalCallable)\nT_template_test = t.TypeVar(\"T_template_test\", bound=ft.TemplateTestCallable)\n\n\ndef _make_timedelta(value: timedelta | int | None) -> timedelta | None:\n if value is None or isinstance(value, timedelta):\n return value\n\n return timedelta(seconds=value)\n", "file2": "if t.TYPE_CHECKING: # pragma: no cover\n from werkzeug.wrappers import Response as BaseResponse\n\n from ..testing import FlaskClient\n from ..testing import FlaskCliRunner\n from .blueprints import Blueprint\n\nT_shell_context_processor = t.TypeVar(\n \"T_shell_context_processor\", bound=ft.ShellContextProcessorCallable\n)\nT_teardown = t.TypeVar(\"T_teardown\", bound=ft.TeardownCallable)\nT_template_filter = t.TypeVar(\"T_template_filter\", bound=ft.TemplateFilterCallable)\nT_template_global = t.TypeVar(\"T_template_global\", bound=ft.TemplateGlobalCallable)\nT_template_test = t.TypeVar(\"T_template_test\", bound=ft.TemplateTestCallable)\n\n\ndef _make_timedelta(value: timedelta | int | None) -> timedelta | None:\n if value is None or isinstance(value, timedelta):\n return value\n\n return timedelta(seconds=value)\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\app.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\sansio\\app.py"}, {"regions": {"file1": " with app.app_context():\n init_db()\n get_db().executescript(_data_sql)\n\n yield app\n\n # close and remove the temporary database\n os.close(db_fd)\n os.unlink(db_path)\n\n\n@pytest.fixture\ndef client(app):\n \"\"\"A test client for the app.\"\"\"\n return app.test_client()\n\n\n@pytest.fixture\ndef runner(app):\n \"\"\"A test runner for the app's Click commands.\"\"\"\n return app.test_cli_runner()\n", "file2": " with app.app_context():\n init_db()\n get_db().executescript(_data_sql)\n\n yield app\n\n os.close(db_fd)\n os.unlink(db_path)\n\n\n @pytest.fixture\n def client(app):\n return app.test_client()\n\n\n @pytest.fixture\n def runner(app):\n return app.test_cli_runner()\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\tutorial\\tests\\conftest.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\tutorial\\tests.rst"}, {"regions": {"file1": " {% if g.user %}\n <li><span>{{ g.user['username'] }}</span>\n <li><a href=\"{{ url_for('auth.logout') }}\">Log Out</a>\n {% else %}\n <li><a href=\"{{ url_for('auth.register') }}\">Register</a>\n <li><a href=\"{{ url_for('auth.login') }}\">Log In</a>\n {% endif %}\n </ul>\n </nav>\n <section class=\"content\">\n <header>\n {% block header %}{% endblock %}\n </header>\n {% for message in get_flashed_messages() %}\n <div class=\"flash\">{{ message }}</div>\n {% endfor %}\n {% block content %}{% endblock %}\n </section>\n", "file2": " {% if g.user %}\n <li><span>{{ g.user['username'] }}</span>\n <li><a href=\"{{ url_for('auth.logout') }}\">Log Out</a>\n {% else %}\n <li><a href=\"{{ url_for('auth.register') }}\">Register</a>\n <li><a href=\"{{ url_for('auth.login') }}\">Log In</a>\n {% endif %}\n </ul>\n</nav>\n<section class=\"content\">\n <header>\n {% block header %}{% endblock %}\n </header>\n {% for message in get_flashed_messages() %}\n <div class=\"flash\">{{ message }}</div>\n {% endfor %}\n {% block content %}{% endblock %}\n</section>\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\tutorial\\templates.rst", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\tutorial\\flaskr\\templates\\base.html"}, {"regions": {"file1": " :param resource: Path to the resource relative to :attr:`root_path`.\n :param mode: Open the file in this mode. Only reading is supported,\n valid values are ``\"r\"`` (or ``\"rt\"``) and ``\"rb\"``.\n :param encoding: Open the file with this encoding when opening in text\n mode. This is ignored when opening in binary mode.\n\n .. versionchanged:: 3.1\n Added the ``encoding`` parameter.\n \"\"\"\n if mode not in {\"r\", \"rt\", \"rb\"}:\n raise ValueError(\"Resources can only be opened for reading.\")\n\n path = os.path.join(self.root_path, resource)\n\n if mode == \"rb\":\n return open(path, mode) # pyright: ignore\n\n return open(path, mode, encoding=encoding)\n", "file2": " :param resource: Path to the resource relative to :attr:`root_path`.\n :param mode: Open the file in this mode. Only reading is supported,\n valid values are ``\"r\"`` (or ``\"rt\"``) and ``\"rb\"``.\n :param encoding: Open the file with this encoding when opening in text\n mode. This is ignored when opening in binary mode.\n\n .. versionchanged:: 3.1\n Added the ``encoding`` parameter.\n \"\"\"\n if mode not in {\"r\", \"rt\", \"rb\"}:\n raise ValueError(\"Resources can only be opened for reading.\")\n\n path = os.path.join(self.root_path, resource)\n\n if mode == \"rb\":\n return open(path, mode) # pyright: ignore\n\n return open(path, mode, encoding=encoding)\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\blueprints.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\app.py"}, {"regions": {"file1": " DROP TABLE IF EXISTS user;\n DROP TABLE IF EXISTS post;\n\n CREATE TABLE user (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n username TEXT UNIQUE NOT NULL,\n password TEXT NOT NULL\n );\n\n CREATE TABLE post (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n author_id INTEGER NOT NULL,\n created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n title TEXT NOT NULL,\n body TEXT NOT NULL,\n FOREIGN KEY (author_id) REFERENCES user (id)\n", "file2": "DROP TABLE IF EXISTS user;\nDROP TABLE IF EXISTS post;\n\nCREATE TABLE user (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n username TEXT UNIQUE NOT NULL,\n password TEXT NOT NULL\n);\n\nCREATE TABLE post (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n author_id INTEGER NOT NULL,\n created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n title TEXT NOT NULL,\n body TEXT NOT NULL,\n FOREIGN KEY (author_id) REFERENCES user (id)\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\tutorial\\database.rst", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\tutorial\\flaskr\\schema.sql"}, {"regions": {"file1": " if error is None:\n try:\n db.execute(\n \"INSERT INTO user (username, password) VALUES (?, ?)\",\n (username, generate_password_hash(password)),\n )\n db.commit()\n except db.IntegrityError:\n # The username was already taken, which caused the\n # commit to fail. Show a validation error.\n error = f\"User {username} is already registered.\"\n else:\n # Success, go to the login page.\n return redirect(url_for(\"auth.login\"))\n\n flash(error)\n", "file2": " if error is None:\n try:\n db.execute(\n \"INSERT INTO user (username, password) VALUES (?, ?)\",\n (username, generate_password_hash(password)),\n )\n db.commit()\n except db.IntegrityError:\n error = f\"User {username} is already registered.\"\n else:\n return redirect(url_for(\"auth.login\"))\n\n flash(error)\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\tutorial\\flaskr\\auth.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\tutorial\\views.rst"}, {"regions": {"file1": " {% extends 'base.html' %}\n\n {% block header %}\n <h1>{% block title %}Register{% endblock %}</h1>\n {% endblock %}\n\n {% block content %}\n <form method=\"post\">\n <label for=\"username\">Username</label>\n <input name=\"username\" id=\"username\" required>\n <label for=\"password\">Password</label>\n <input type=\"password\" name=\"password\" id=\"password\" required>\n <input type=\"submit\" value=\"Register\">\n </form>\n {% endblock %}\n", "file2": "{% extends 'base.html' %}\n\n{% block header %}\n <h1>{% block title %}Register{% endblock %}</h1>\n{% endblock %}\n\n{% block content %}\n <form method=\"post\">\n <label for=\"username\">Username</label>\n <input name=\"username\" id=\"username\" required>\n <label for=\"password\">Password</label>\n <input type=\"password\" name=\"password\" id=\"password\" required>\n <input type=\"submit\" value=\"Register\">\n </form>\n{% endblock %}\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\tutorial\\templates.rst", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\tutorial\\flaskr\\templates\\auth\\register.html"}, {"regions": {"file1": "{% extends 'base.html' %}\n\n{% block header %}\n <h1>{% block title %}Log In{% endblock %}</h1>\n{% endblock %}\n\n{% block content %}\n <form method=\"post\">\n <label for=\"username\">Username</label>\n <input name=\"username\" id=\"username\" required>\n <label for=\"password\">Password</label>\n <input type=\"password\" name=\"password\" id=\"password\" required>\n <input type=\"submit\" value=\"Log In\">\n </form>\n{% endblock %}\n", "file2": " {% extends 'base.html' %}\n\n {% block header %}\n <h1>{% block title %}Log In{% endblock %}</h1>\n {% endblock %}\n\n {% block content %}\n <form method=\"post\">\n <label for=\"username\">Username</label>\n <input name=\"username\" id=\"username\" required>\n <label for=\"password\">Password</label>\n <input type=\"password\" name=\"password\" id=\"password\" required>\n <input type=\"submit\" value=\"Log In\">\n </form>\n {% endblock %}\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\tutorial\\flaskr\\templates\\auth\\login.html", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\tutorial\\templates.rst"}, {"regions": {"file1": ".venv/\n*.pyc\n__pycache__/\ninstance/\n.cache/\n.pytest_cache/\n.coverage\nhtmlcov/\ndist/\nbuild/\n*.egg-info/\n.idea/\n*.swp\n", "file2": ".venv/\n*.pyc\n__pycache__/\ninstance/\n.cache/\n.pytest_cache/\n.coverage\nhtmlcov/\ndist/\nbuild/\n*.egg-info/\n.idea/\n*.swp\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\javascript\\.gitignore", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\tutorial\\.gitignore"}, {"regions": {"file1": " values.setdefault(\"lang_code\", flask.g.lang_code)\n\n @app.url_value_preprocessor\n def pull_lang_code(endpoint, values):\n flask.g.lang_code = values.pop(\"lang_code\", None)\n\n @app.route(\"/<lang_code>/\")\n def index():\n return flask.url_for(\"about\")\n\n @app.route(\"/<lang_code>/about\")\n def about():\n", "file2": " values.setdefault(\"lang_code\", flask.g.lang_code)\n\n @bp.app_url_value_preprocessor\n def pull_lang_code(endpoint, values):\n flask.g.lang_code = values.pop(\"lang_code\")\n\n # Register route rules at the app level\n @app.route(\"/<lang_code>/\")\n def index():\n return flask.url_for(\"about\")\n\n @app.route(\"/<lang_code>/about\")\n def about():\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\tests\\test_basic.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\tests\\test_blueprints.py"}, {"regions": {"file1": "The Jinja2 template engine supports rendering a template piece by\npiece, returning an iterator of strings. Flask provides the\n:func:`~flask.stream_template` and :func:`~flask.stream_template_string`\nfunctions to make this easier to use.\n\n.. code-block:: python\n\n from flask import stream_template\n\n @app.get(\"/timeline\")\n def timeline():\n return stream_template(\"timeline.html\")\n", "file2": "The Jinja2 template engine supports rendering a template piece\nby piece, returning an iterator of strings. Flask provides the\n:func:`~flask.stream_template` and :func:`~flask.stream_template_string`\nfunctions to make this easier to use.\n\n.. code-block:: python\n\n from flask import stream_template\n\n @app.get(\"/timeline\")\n def timeline():\n return stream_template(\"timeline.html\")\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\patterns\\streaming.rst", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\templating.rst"}, {"regions": {"file1": " def __init__(\n self,\n import_name: str,\n static_url_path: str | None = None,\n static_folder: str | os.PathLike[str] | None = \"static\",\n static_host: str | None = None,\n host_matching: bool = False,\n subdomain_matching: bool = False,\n template_folder: str | os.PathLike[str] | None = \"templates\",\n instance_path: str | None = None,\n instance_relative_config: bool = False,\n root_path: str | None = None,\n", "file2": " def __init__(\n self,\n import_name: str,\n static_url_path: str | None = None,\n static_folder: str | os.PathLike[str] | None = \"static\",\n static_host: str | None = None,\n host_matching: bool = False,\n subdomain_matching: bool = False,\n template_folder: str | os.PathLike[str] | None = \"templates\",\n instance_path: str | None = None,\n instance_relative_config: bool = False,\n root_path: str | None = None,\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\sansio\\app.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\app.py"}, {"regions": {"file1": " def create_app() -> Flask:\n app = Flask(__name__)\n app.config.from_mapping(\n CELERY=dict(\n broker_url=\"redis://localhost\",\n result_backend=\"redis://localhost\",\n task_ignore_result=True,\n ),\n )\n app.config.from_prefixed_env()\n celery_init_app(app)\n", "file2": "def create_app() -> Flask:\n app = Flask(__name__)\n app.config.from_mapping(\n CELERY=dict(\n broker_url=\"redis://localhost\",\n result_backend=\"redis://localhost\",\n task_ignore_result=True,\n ),\n )\n app.config.from_prefixed_env()\n celery_init_app(app)\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\patterns\\celery.rst", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\celery\\src\\task_app\\__init__.py"}, {"regions": {"file1": "def celery_init_app(app: Flask) -> Celery:\n class FlaskTask(Task):\n def __call__(self, *args: object, **kwargs: object) -> object:\n with app.app_context():\n return self.run(*args, **kwargs)\n\n celery_app = Celery(app.name, task_cls=FlaskTask)\n celery_app.config_from_object(app.config[\"CELERY\"])\n celery_app.set_default()\n app.extensions[\"celery\"] = celery_app\n return celery_app\n", "file2": " def celery_init_app(app: Flask) -> Celery:\n class FlaskTask(Task):\n def __call__(self, *args: object, **kwargs: object) -> object:\n with app.app_context():\n return self.run(*args, **kwargs)\n\n celery_app = Celery(app.name, task_cls=FlaskTask)\n celery_app.config_from_object(app.config[\"CELERY\"])\n celery_app.set_default()\n app.extensions[\"celery\"] = celery_app\n return celery_app\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\examples\\celery\\src\\task_app\\__init__.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\docs\\patterns\\celery.rst"}, {"regions": {"file1": " def __init__(\n self,\n name: str,\n import_name: str,\n static_folder: str | os.PathLike[str] | None = None,\n static_url_path: str | None = None,\n template_folder: str | os.PathLike[str] | None = None,\n url_prefix: str | None = None,\n subdomain: str | None = None,\n url_defaults: dict[str, t.Any] | None = None,\n root_path: str | None = None,\n", "file2": " def __init__(\n self,\n name: str,\n import_name: str,\n static_folder: str | os.PathLike[str] | None = None,\n static_url_path: str | None = None,\n template_folder: str | os.PathLike[str] | None = None,\n url_prefix: str | None = None,\n subdomain: str | None = None,\n url_defaults: dict[str, t.Any] | None = None,\n root_path: str | None = None,\n"}, "file1": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\blueprints.py", "file2": "C:\\Users\\422mi\\refactor-analyzer\\codebase\\flask\\src\\flask\\sansio\\blueprints.py"}]