We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
New streamlit.beta_page_config
# Summary

I called streamlit.beta_page_config once at the beginning of the code, It works at start, but, when using slider in app, it reports the error:
`StreamlitAPIException: beta_set_page_config() can only be called once per app, and must be called as the first Streamlit command in your script.
`
# Steps to reproduce

What are the steps we should take to reproduce the bug:

1. Go to 'https://nimani.diplomacy.edu:8502/'
2. Click on 'Isolation Forest ' radio button from sidebar menu
3. try to change slider 'Contamination' on sidebar menu

## Expected behavior:

It should show updated plotly table

## Actual behavior:

It reports error:
`StreamlitAPIException: beta_set_page_config() can only be called once per app, and must be called as the first Streamlit command in your script.

## Is this a regression?

That is, did this use to work the way you expected in the past?
no, feature did not exist in earlier versions, since it is a new beta feature

# Debug info

- Streamlit version: 0.65.1
- Python version: 3.7.7
- Using Conda? PipEnv? PyEnv? Pex? No
- OS version: Ubuntu 18.04
- Browser version: Google Chrome, Version 84.0.4147.125

# Additional information

If needed, add any other context about the problem here. For example, did this bug come from https://discuss.streamlit.io or another site? Link the original source here!


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `lib/streamlit/report_thread.py`
Content:
```
1 # Copyright 2018-2020 Streamlit Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #    http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 import threading
16 
17 from streamlit.logger import get_logger
18 from streamlit.errors import StreamlitAPIException
19 
20 LOGGER = get_logger(__name__)
21 
22 
23 class ReportContext(object):
24     def __init__(
25         self,
26         session_id,
27         enqueue,
28         query_string,
29         widgets,
30         widget_ids_this_run,
31         uploaded_file_mgr,
32     ):
33         """Construct a ReportContext.
34 
35         Parameters
36         ----------
37         session_id : str
38             The ReportSession's id.
39         enqueue : callable
40             Function that enqueues ForwardMsg protos in the websocket.
41         query_string : str
42             The URL query string for this run.
43         widgets : Widgets
44             The Widgets state object for the report.
45         widget_ids_this_run : _WidgetIDSet
46             The set of widget IDs that have been assigned in the
47             current report run. This set is cleared at the start of each run.
48         uploaded_file_mgr : UploadedFileManager
49             The manager for files uploaded by all users.
50 
51         """
52         # (dict) Mapping of container (type str or BlockPath) to top-level
53         # cursor (type AbstractCursor).
54         self.cursors = {}
55         self.session_id = session_id
56         self._enqueue = enqueue
57         self.query_string = query_string
58         self.widgets = widgets
59         self.widget_ids_this_run = widget_ids_this_run
60         self.uploaded_file_mgr = uploaded_file_mgr
61 
62         # set_page_config is allowed at most once, as the very first st.command
63         self._set_page_config_allowed = True
64 
65     def reset(self, query_string=""):
66         self.cursors = {}
67         self.widget_ids_this_run.clear()
68         self.query_string = query_string
69 
70     def enqueue(self, msg):
71         if msg.HasField("page_config_changed") and not self._set_page_config_allowed:
72             raise StreamlitAPIException(
73                 "`beta_set_page_config()` can only be called once per app, "
74                 + "and must be called as the first Streamlit command in your script.\n\n"
75                 + "For more information refer to the [docs]"
76                 + "(https://docs.streamlit.io/en/stable/api.html#streamlit.beta_set_page_config)."
77             )
78 
79         if msg.HasField("delta") or msg.HasField("page_config_changed"):
80             self._set_page_config_allowed = False
81 
82         self._enqueue(msg)
83 
84 
85 class _WidgetIDSet(object):
86     """Stores a set of widget IDs. Safe to mutate from multiple threads."""
87 
88     def __init__(self):
89         self._lock = threading.Lock()
90         self._items = set()
91 
92     def clear(self):
93         """Clears all items in the set."""
94         with self._lock:
95             self._items.clear()
96 
97     def add(self, item):
98         """Adds an item to the set.
99 
100         Parameters
101         ----------
102         item : Any
103             The item to add.
104 
105         Returns
106         -------
107         bool
108             True if the item was added, and False if it was already in
109             the set.
110 
111         """
112         with self._lock:
113             if item in self._items:
114                 return False
115             self._items.add(item)
116             return True
117 
118 
119 REPORT_CONTEXT_ATTR_NAME = "streamlit_report_ctx"
120 
121 
122 class ReportThread(threading.Thread):
123     """Extends threading.Thread with a ReportContext member"""
124 
125     def __init__(
126         self,
127         session_id,
128         enqueue,
129         query_string,
130         widgets,
131         uploaded_file_mgr=None,
132         target=None,
133         name=None,
134     ):
135         """Construct a ReportThread.
136 
137         Parameters
138         ----------
139         session_id : str
140             The ReportSession's id.
141         enqueue : callable
142             Function that enqueues ForwardMsg protos in the websocket.
143         query_string : str
144             The URL query string for this run.
145         widgets : Widgets
146             The Widgets state object for the report.
147         uploaded_file_mgr : UploadedFileManager
148             The manager for files uploaded by all users.
149         target : callable
150             The callable object to be invoked by the run() method.
151             Defaults to None, meaning nothing is called.
152         name : str
153             The thread name. By default, a unique name is constructed of
154             the form "Thread-N" where N is a small decimal number.
155 
156         """
157         super(ReportThread, self).__init__(target=target, name=name)
158         self.streamlit_report_ctx = ReportContext(
159             session_id=session_id,
160             enqueue=enqueue,
161             query_string=query_string,
162             widgets=widgets,
163             uploaded_file_mgr=uploaded_file_mgr,
164             widget_ids_this_run=_WidgetIDSet(),
165         )
166 
167 
168 def add_report_ctx(thread=None, ctx=None):
169     """Adds the current ReportContext to a newly-created thread.
170 
171     This should be called from this thread's parent thread,
172     before the new thread starts.
173 
174     Parameters
175     ----------
176     thread : threading.Thread
177         The thread to attach the current ReportContext to.
178     ctx : ReportContext or None
179         The ReportContext to add, or None to use the current thread's
180         ReportContext.
181 
182     Returns
183     -------
184     threading.Thread
185         The same thread that was passed in, for chaining.
186 
187     """
188     if thread is None:
189         thread = threading.current_thread()
190     if ctx is None:
191         ctx = get_report_ctx()
192     if ctx is not None:
193         setattr(thread, REPORT_CONTEXT_ATTR_NAME, ctx)
194     return thread
195 
196 
197 def get_report_ctx():
198     """
199     Returns
200     -------
201     ReportContext | None
202         The current thread's ReportContext, or None if it doesn't have one.
203 
204     """
205     thread = threading.current_thread()
206     ctx = getattr(thread, REPORT_CONTEXT_ATTR_NAME, None)
207     if ctx is None and streamlit._is_running_with_streamlit:
208         # Only warn about a missing ReportContext if we were started
209         # via `streamlit run`. Otherwise, the user is likely running a
210         # script "bare", and doesn't need to be warned about streamlit
211         # bits that are irrelevant when not connected to a report.
212         LOGGER.warning("Thread '%s': missing ReportContext" % thread.name)
213     return ctx
214 
215 
216 # Needed to avoid circular dependencies while running tests.
217 import streamlit
218
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/lib/streamlit/report_thread.py b/lib/streamlit/report_thread.py
--- a/lib/streamlit/report_thread.py
+++ b/lib/streamlit/report_thread.py
@@ -58,7 +58,6 @@
         self.widgets = widgets
         self.widget_ids_this_run = widget_ids_this_run
         self.uploaded_file_mgr = uploaded_file_mgr
-
         # set_page_config is allowed at most once, as the very first st.command
         self._set_page_config_allowed = True
 
@@ -66,6 +65,8 @@
         self.cursors = {}
         self.widget_ids_this_run.clear()
         self.query_string = query_string
+        # Permit set_page_config when the ReportContext is reused on a rerun
+        self._set_page_config_allowed = True
 
     def enqueue(self, msg):
         if msg.HasField("page_config_changed") and not self._set_page_config_allowed:

{"golden_diff": "diff --git a/lib/streamlit/report_thread.py b/lib/streamlit/report_thread.py\n--- a/lib/streamlit/report_thread.py\n+++ b/lib/streamlit/report_thread.py\n@@ -58,7 +58,6 @@\n         self.widgets = widgets\n         self.widget_ids_this_run = widget_ids_this_run\n         self.uploaded_file_mgr = uploaded_file_mgr\n-\n         # set_page_config is allowed at most once, as the very first st.command\n         self._set_page_config_allowed = True\n \n@@ -66,6 +65,8 @@\n         self.cursors = {}\n         self.widget_ids_this_run.clear()\n         self.query_string = query_string\n+        # Permit set_page_config when the ReportContext is reused on a rerun\n+        self._set_page_config_allowed = True\n \n     def enqueue(self, msg):\n         if msg.HasField(\"page_config_changed\") and not self._set_page_config_allowed:\n", "issue": "New streamlit.beta_page_config\n# Summary\r\n\r\nI called streamlit.beta_page_config once at the beginning of the code, It works at start, but, when using slider in app, it reports the error:\r\n`StreamlitAPIException: beta_set_page_config() can only be called once per app, and must be called as the first Streamlit command in your script.\r\n`\r\n# Steps to reproduce\r\n\r\nWhat are the steps we should take to reproduce the bug:\r\n\r\n1. Go to 'https://nimani.diplomacy.edu:8502/'\r\n2. Click on 'Isolation Forest ' radio button from sidebar menu\r\n3. try to change slider 'Contamination' on sidebar menu\r\n\r\n## Expected behavior:\r\n\r\nIt should show updated plotly table\r\n\r\n## Actual behavior:\r\n\r\nIt reports error:\r\n`StreamlitAPIException: beta_set_page_config() can only be called once per app, and must be called as the first Streamlit command in your script.\r\n\r\n## Is this a regression?\r\n\r\nThat is, did this use to work the way you expected in the past?\r\nno, feature did not exist in earlier versions, since it is a new beta feature\r\n\r\n# Debug info\r\n\r\n- Streamlit version: 0.65.1\r\n- Python version: 3.7.7\r\n- Using Conda? PipEnv? PyEnv? Pex? No\r\n- OS version: Ubuntu 18.04\r\n- Browser version: Google Chrome, Version 84.0.4147.125\r\n\r\n# Additional information\r\n\r\nIf needed, add any other context about the problem here. For example, did this bug come from https://discuss.streamlit.io or another site? Link the original source here!\r\n\n", "before_files": [{"content": "# Copyright 2018-2020 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport threading\n\nfrom streamlit.logger import get_logger\nfrom streamlit.errors import StreamlitAPIException\n\nLOGGER = get_logger(__name__)\n\n\nclass ReportContext(object):\n    def __init__(\n        self,\n        session_id,\n        enqueue,\n        query_string,\n        widgets,\n        widget_ids_this_run,\n        uploaded_file_mgr,\n    ):\n        \"\"\"Construct a ReportContext.\n\n        Parameters\n        ----------\n        session_id : str\n            The ReportSession's id.\n        enqueue : callable\n            Function that enqueues ForwardMsg protos in the websocket.\n        query_string : str\n            The URL query string for this run.\n        widgets : Widgets\n            The Widgets state object for the report.\n        widget_ids_this_run : _WidgetIDSet\n            The set of widget IDs that have been assigned in the\n            current report run. This set is cleared at the start of each run.\n        uploaded_file_mgr : UploadedFileManager\n            The manager for files uploaded by all users.\n\n        \"\"\"\n        # (dict) Mapping of container (type str or BlockPath) to top-level\n        # cursor (type AbstractCursor).\n        self.cursors = {}\n        self.session_id = session_id\n        self._enqueue = enqueue\n        self.query_string = query_string\n        self.widgets = widgets\n        self.widget_ids_this_run = widget_ids_this_run\n        self.uploaded_file_mgr = uploaded_file_mgr\n\n        # set_page_config is allowed at most once, as the very first st.command\n        self._set_page_config_allowed = True\n\n    def reset(self, query_string=\"\"):\n        self.cursors = {}\n        self.widget_ids_this_run.clear()\n        self.query_string = query_string\n\n    def enqueue(self, msg):\n        if msg.HasField(\"page_config_changed\") and not self._set_page_config_allowed:\n            raise StreamlitAPIException(\n                \"`beta_set_page_config()` can only be called once per app, \"\n                + \"and must be called as the first Streamlit command in your script.\\n\\n\"\n                + \"For more information refer to the [docs]\"\n                + \"(https://docs.streamlit.io/en/stable/api.html#streamlit.beta_set_page_config).\"\n            )\n\n        if msg.HasField(\"delta\") or msg.HasField(\"page_config_changed\"):\n            self._set_page_config_allowed = False\n\n        self._enqueue(msg)\n\n\nclass _WidgetIDSet(object):\n    \"\"\"Stores a set of widget IDs. Safe to mutate from multiple threads.\"\"\"\n\n    def __init__(self):\n        self._lock = threading.Lock()\n        self._items = set()\n\n    def clear(self):\n        \"\"\"Clears all items in the set.\"\"\"\n        with self._lock:\n            self._items.clear()\n\n    def add(self, item):\n        \"\"\"Adds an item to the set.\n\n        Parameters\n        ----------\n        item : Any\n            The item to add.\n\n        Returns\n        -------\n        bool\n            True if the item was added, and False if it was already in\n            the set.\n\n        \"\"\"\n        with self._lock:\n            if item in self._items:\n                return False\n            self._items.add(item)\n            return True\n\n\nREPORT_CONTEXT_ATTR_NAME = \"streamlit_report_ctx\"\n\n\nclass ReportThread(threading.Thread):\n    \"\"\"Extends threading.Thread with a ReportContext member\"\"\"\n\n    def __init__(\n        self,\n        session_id,\n        enqueue,\n        query_string,\n        widgets,\n        uploaded_file_mgr=None,\n        target=None,\n        name=None,\n    ):\n        \"\"\"Construct a ReportThread.\n\n        Parameters\n        ----------\n        session_id : str\n            The ReportSession's id.\n        enqueue : callable\n            Function that enqueues ForwardMsg protos in the websocket.\n        query_string : str\n            The URL query string for this run.\n        widgets : Widgets\n            The Widgets state object for the report.\n        uploaded_file_mgr : UploadedFileManager\n            The manager for files uploaded by all users.\n        target : callable\n            The callable object to be invoked by the run() method.\n            Defaults to None, meaning nothing is called.\n        name : str\n            The thread name. By default, a unique name is constructed of\n            the form \"Thread-N\" where N is a small decimal number.\n\n        \"\"\"\n        super(ReportThread, self).__init__(target=target, name=name)\n        self.streamlit_report_ctx = ReportContext(\n            session_id=session_id,\n            enqueue=enqueue,\n            query_string=query_string,\n            widgets=widgets,\n            uploaded_file_mgr=uploaded_file_mgr,\n            widget_ids_this_run=_WidgetIDSet(),\n        )\n\n\ndef add_report_ctx(thread=None, ctx=None):\n    \"\"\"Adds the current ReportContext to a newly-created thread.\n\n    This should be called from this thread's parent thread,\n    before the new thread starts.\n\n    Parameters\n    ----------\n    thread : threading.Thread\n        The thread to attach the current ReportContext to.\n    ctx : ReportContext or None\n        The ReportContext to add, or None to use the current thread's\n        ReportContext.\n\n    Returns\n    -------\n    threading.Thread\n        The same thread that was passed in, for chaining.\n\n    \"\"\"\n    if thread is None:\n        thread = threading.current_thread()\n    if ctx is None:\n        ctx = get_report_ctx()\n    if ctx is not None:\n        setattr(thread, REPORT_CONTEXT_ATTR_NAME, ctx)\n    return thread\n\n\ndef get_report_ctx():\n    \"\"\"\n    Returns\n    -------\n    ReportContext | None\n        The current thread's ReportContext, or None if it doesn't have one.\n\n    \"\"\"\n    thread = threading.current_thread()\n    ctx = getattr(thread, REPORT_CONTEXT_ATTR_NAME, None)\n    if ctx is None and streamlit._is_running_with_streamlit:\n        # Only warn about a missing ReportContext if we were started\n        # via `streamlit run`. Otherwise, the user is likely running a\n        # script \"bare\", and doesn't need to be warned about streamlit\n        # bits that are irrelevant when not connected to a report.\n        LOGGER.warning(\"Thread '%s': missing ReportContext\" % thread.name)\n    return ctx\n\n\n# Needed to avoid circular dependencies while running tests.\nimport streamlit\n", "path": "lib/streamlit/report_thread.py"}], "after_files": [{"content": "# Copyright 2018-2020 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport threading\n\nfrom streamlit.logger import get_logger\nfrom streamlit.errors import StreamlitAPIException\n\nLOGGER = get_logger(__name__)\n\n\nclass ReportContext(object):\n    def __init__(\n        self,\n        session_id,\n        enqueue,\n        query_string,\n        widgets,\n        widget_ids_this_run,\n        uploaded_file_mgr,\n    ):\n        \"\"\"Construct a ReportContext.\n\n        Parameters\n        ----------\n        session_id : str\n            The ReportSession's id.\n        enqueue : callable\n            Function that enqueues ForwardMsg protos in the websocket.\n        query_string : str\n            The URL query string for this run.\n        widgets : Widgets\n            The Widgets state object for the report.\n        widget_ids_this_run : _WidgetIDSet\n            The set of widget IDs that have been assigned in the\n            current report run. This set is cleared at the start of each run.\n        uploaded_file_mgr : UploadedFileManager\n            The manager for files uploaded by all users.\n\n        \"\"\"\n        # (dict) Mapping of container (type str or BlockPath) to top-level\n        # cursor (type AbstractCursor).\n        self.cursors = {}\n        self.session_id = session_id\n        self._enqueue = enqueue\n        self.query_string = query_string\n        self.widgets = widgets\n        self.widget_ids_this_run = widget_ids_this_run\n        self.uploaded_file_mgr = uploaded_file_mgr\n        # set_page_config is allowed at most once, as the very first st.command\n        self._set_page_config_allowed = True\n\n    def reset(self, query_string=\"\"):\n        self.cursors = {}\n        self.widget_ids_this_run.clear()\n        self.query_string = query_string\n        # Permit set_page_config when the ReportContext is reused on a rerun\n        self._set_page_config_allowed = True\n\n    def enqueue(self, msg):\n        if msg.HasField(\"page_config_changed\") and not self._set_page_config_allowed:\n            raise StreamlitAPIException(\n                \"`beta_set_page_config()` can only be called once per app, \"\n                + \"and must be called as the first Streamlit command in your script.\\n\\n\"\n                + \"For more information refer to the [docs]\"\n                + \"(https://docs.streamlit.io/en/stable/api.html#streamlit.beta_set_page_config).\"\n            )\n\n        if msg.HasField(\"delta\") or msg.HasField(\"page_config_changed\"):\n            self._set_page_config_allowed = False\n\n        self._enqueue(msg)\n\n\nclass _WidgetIDSet(object):\n    \"\"\"Stores a set of widget IDs. Safe to mutate from multiple threads.\"\"\"\n\n    def __init__(self):\n        self._lock = threading.Lock()\n        self._items = set()\n\n    def clear(self):\n        \"\"\"Clears all items in the set.\"\"\"\n        with self._lock:\n            self._items.clear()\n\n    def add(self, item):\n        \"\"\"Adds an item to the set.\n\n        Parameters\n        ----------\n        item : Any\n            The item to add.\n\n        Returns\n        -------\n        bool\n            True if the item was added, and False if it was already in\n            the set.\n\n        \"\"\"\n        with self._lock:\n            if item in self._items:\n                return False\n            self._items.add(item)\n            return True\n\n\nREPORT_CONTEXT_ATTR_NAME = \"streamlit_report_ctx\"\n\n\nclass ReportThread(threading.Thread):\n    \"\"\"Extends threading.Thread with a ReportContext member\"\"\"\n\n    def __init__(\n        self,\n        session_id,\n        enqueue,\n        query_string,\n        widgets,\n        uploaded_file_mgr=None,\n        target=None,\n        name=None,\n    ):\n        \"\"\"Construct a ReportThread.\n\n        Parameters\n        ----------\n        session_id : str\n            The ReportSession's id.\n        enqueue : callable\n            Function that enqueues ForwardMsg protos in the websocket.\n        query_string : str\n            The URL query string for this run.\n        widgets : Widgets\n            The Widgets state object for the report.\n        uploaded_file_mgr : UploadedFileManager\n            The manager for files uploaded by all users.\n        target : callable\n            The callable object to be invoked by the run() method.\n            Defaults to None, meaning nothing is called.\n        name : str\n            The thread name. By default, a unique name is constructed of\n            the form \"Thread-N\" where N is a small decimal number.\n\n        \"\"\"\n        super(ReportThread, self).__init__(target=target, name=name)\n        self.streamlit_report_ctx = ReportContext(\n            session_id=session_id,\n            enqueue=enqueue,\n            query_string=query_string,\n            widgets=widgets,\n            uploaded_file_mgr=uploaded_file_mgr,\n            widget_ids_this_run=_WidgetIDSet(),\n        )\n\n\ndef add_report_ctx(thread=None, ctx=None):\n    \"\"\"Adds the current ReportContext to a newly-created thread.\n\n    This should be called from this thread's parent thread,\n    before the new thread starts.\n\n    Parameters\n    ----------\n    thread : threading.Thread\n        The thread to attach the current ReportContext to.\n    ctx : ReportContext or None\n        The ReportContext to add, or None to use the current thread's\n        ReportContext.\n\n    Returns\n    -------\n    threading.Thread\n        The same thread that was passed in, for chaining.\n\n    \"\"\"\n    if thread is None:\n        thread = threading.current_thread()\n    if ctx is None:\n        ctx = get_report_ctx()\n    if ctx is not None:\n        setattr(thread, REPORT_CONTEXT_ATTR_NAME, ctx)\n    return thread\n\n\ndef get_report_ctx():\n    \"\"\"\n    Returns\n    -------\n    ReportContext | None\n        The current thread's ReportContext, or None if it doesn't have one.\n\n    \"\"\"\n    thread = threading.current_thread()\n    ctx = getattr(thread, REPORT_CONTEXT_ATTR_NAME, None)\n    if ctx is None and streamlit._is_running_with_streamlit:\n        # Only warn about a missing ReportContext if we were started\n        # via `streamlit run`. Otherwise, the user is likely running a\n        # script \"bare\", and doesn't need to be warned about streamlit\n        # bits that are irrelevant when not connected to a report.\n        LOGGER.warning(\"Thread '%s': missing ReportContext\" % thread.name)\n    return ctx\n\n\n# Needed to avoid circular dependencies while running tests.\nimport streamlit\n", "path": "lib/streamlit/report_thread.py"}]}