IndexError: Cannot choose from an empty sequence // Werkzeug Debugger var CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = "Cztug1SITH6VWk19YYTC";
IndexError
IndexError: Cannot choose from an empty sequence
Traceback(most recent call last)
The above exception was the direct cause of the following exception:File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line2551, in__call__
def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:
"""The WSGI server calls the Flask application object as the
WSGI application. This calls :meth:`wsgi_app`, which can be
wrapped to apply middleware.
"""
return self.wsgi_app(environ, start_response)
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line2531, inwsgi_app
try:
ctx.push()
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.handle_exception(e)
except: # noqa: B001
error = sys.exc_info()[1]
raise
return response(environ, start_response)
finally:
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line2528, inwsgi_app
ctx = self.request_context(environ)
error: t.Optional[BaseException] = None
try:
try:
ctx.push()
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.handle_exception(e)
except: # noqa: B001
error = sys.exc_info()[1]
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line1825, infull_dispatch_request
request_started.send(self)
rv = self.preprocess_request()
if rv is None:
rv = self.dispatch_request()
except Exception as e:
rv = self.handle_user_exception(e)
return self.finalize_request(rv)
def finalize_request(
self,
rv: t.Union[ft.ResponseReturnValue, HTTPException],
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line1823, infull_dispatch_request
try:
request_started.send(self)
rv = self.preprocess_request()
if rv is None:
rv = self.dispatch_request()
except Exception as e:
rv = self.handle_user_exception(e)
return self.finalize_request(rv)
def finalize_request(
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line1799, indispatch_request
and req.method == "OPTIONS"
):
return self.make_default_options_response()
# otherwise dispatch to the handler for that endpoint
view_args: t.Dict[str, t.Any] = req.view_args # type: ignore[assignment]
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
def full_dispatch_request(self) -> Response:
"""Dispatches the request and on top of that performs request
pre and postprocessing as well as HTTP exception catching and
error handling.
File "/www/wwwroot/chat.py", line39, ingen_header
# post入参访问方式二:from-data(k-v)格式参数
@api.route('/gen_header', methods=['post'])
def gen_header():
wd = flask.request.values.get('wd')
future = executor.submit(do_heavy_work,wd)
return str(future.result())
def do_heavy_work(wd):
prompt = wd
#openai.api_key = api_key_list[-1]
openai.api_key = random.choice(api_key_list)
File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line435, inresult
self._condition.wait(timeout)
if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
raise CancelledError()
elif self._state == FINISHED:
return self.__get_result()
else:
raise TimeoutError()
def exception(self, timeout=None):
"""Return the exception raised by the call that the future represents.
File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line384, in__get_result
with self._condition:
return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]
def __get_result(self):
if self._exception:
raise self._exception
else:
return self._result
def add_done_callback(self, fn):
"""Attaches a callable that will be called when the future finishes.IndexError: Cannot choose from an empty sequence
This is the Copy/Paste friendly version of the traceback.
concurrent.futures.process._RemoteTraceback: """Traceback (most recent call last): File "/usr/local/python3/lib/python3.7/concurrent/futures/process.py", line 239, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) File "/www/wwwroot/chat.py", line 44, in do_heavy_work openai.api_key = random.choice(api_key_list) File "/usr/local/python3/lib/python3.7/random.py", line 261, in choice raise IndexError('Cannot choose from an empty sequence') from NoneIndexError: Cannot choose from an empty sequence"""The above exception was the direct cause of the following exception:Traceback (most recent call last): File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2551, in __call__ return self.wsgi_app(environ, start_response) File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2531, in wsgi_app response = self.handle_exception(e) File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2528, in wsgi_app response = self.full_dispatch_request() File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/www/wwwroot/chat.py", line 39, in gen_header return str(future.result()) File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line 435, in result return self.__get_result() File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result raise self._exceptionIndexError: Cannot choose from an empty sequenceThe debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.Brought to you byDON'T PANIC, your friendly Werkzeug powered traceback interpreter.Console Locked
The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server.
PIN:
一:lock是什么开关装置
lock按键是点火开关。汽车点火开关有START、ON、ACC、LOCK四个档位。LOCK是锁定方向盘的,ACC是可以打开部分电器元件,如收音机等,ON接通车中所有电器元件,车辆行驶过程中就在此位置,START为启动位置点火用的。
点火开关的概括
点火开关。点火系统的开关通常要使用钥匙,可自由开启或关闭点火线圈的主要电路,也适用于其它电系电路。点火开关俗称总开关、总电门或是总钥匙,它是控制全车电路系统的总闸门。它有插接式和旋钮式两种。
点火开关由钥匙、钥匙插座、外接导线和插片等组成。点火开关一般安装在车头上方或是仪表盘的中心位置处,它更直接更明了地说明该开关内部控制状态与外部导线的连接 *** ,这也是使用者最为关心的。
二:相机lock是什么开关
使用手动曝光时,为了防止光圈经常无意中发生变化,可以将其锁定。
三:四驱汽车lock是什么开关
小型汽车的启动装置一般分为两种,一种是通过旋转点火开关钥匙启动汽车的启动装置,也称“钥匙启动”。还有一种是通过点击按键启动汽车的启动装置,又称为“无匙启动”或称“一键启动”。
(一)钥匙启动一般使用钥匙启动的点火开关内部都设置有四个不同档位。
其排列如下:
① LOCK— 是插入和拔出点火开关钥匙的位置。
② ACC— 是插入钥匙后顺时针旋转的第一挡,发动机处于未启动(熄火)状态。此时,只能使用汽车音响设备。
③ ON— 是插入钥匙后顺时针旋转的第二档是发动机启动后所处的位置,能够显示数据、雨刷器、电动车窗、电动后视镜、空调、转向灯等所有电器设备。当发动机尚未启动时或熄火后,设置该位置仍然能够使用音响、雨刷、电动车窗、电动后视镜等用电设备。
④ START— 是插入钥匙后顺时针旋转的第三档,它是启动发动机的位置。该位置为“弹力开关”,当发动机被启动后松开点火开关钥匙,点火开关会自动弹回到ON位置。
注意!发动机一旦启动,应立即松开点火开关钥匙,切勿让起动机跟随发动机一起运转,以防损坏起动机。
拔出钥匙时一定要使变速杆设定到P停车挡位置才能拔出钥匙,另外,当您将钥匙拧到ACC熄火的位置时还无法取下钥匙,还需将钥匙向锁芯内推送并再逆时针旋转一档,至LOXK插入拔出位置才能将钥匙拔出。
钥匙启动开关示意图
(二)无匙启动(一键启动)无匙启动是通过按键启动汽车的启动装置,又称为“一键启动”。
其操作 *** 如下:
①在不踩刹车的状态下点击一下启动按钮,相当于钥匙启动的ACC(即插入钥匙后旋转的第一挡)。此时,只能使用汽车音响、收音机。
②在不踩刹车的状态下再点击一下启动按钮,相当于钥匙启动的NO(即插入钥匙后旋转的第二档)。此时,为仪表检测阶段能够使用仪表显示、雨刷器、电动车窗、电动后视镜、空调、转向灯等所有电器设备。当发动机尚未启动时或熄火后,设置该位置仍然能够使用音响、雨刷、电动车窗、电动后视镜等用电设备。
② 在踩住刹车踏板的状态下按一下启动按钮,相当于钥匙启动的“启动挡”START(即插入钥匙后旋转的第三挡)。此时,发动机被启动。注意:点击一下即可启动发动机,不要长时间按压启动按钮。

无匙启动(一键启动)开关示意图
版权声明:免责声明:本文来源网友投稿及网络整合仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。投诉邮箱:1765130767@qq.com.