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:
点击右上角“关注”每天了解最新TVB资讯
本文编辑剧透社:小彤
未经授权严禁转载,发现抄袭者小编将进行降维打击!
香港艺人黄心颖与许志安被爆出偷食事件后,太太郑秀文一直没有表态,不过有网友郑秀文Facebook的主页封面换成了一片黑色的图片,不知道是否代表着这段爱情已经死亡。
随后还发现郑秀文经纪人郭启华的Facebook头像也换成了黑色图片,不知道是否与许志安偷食事件有关。

4月16日,香港媒体爆出许志安与马国明女友黄心颖偷食的短片,这个长达16分钟的短片中许志安与黄心颖两人在的士上亲热,互动非常的 *** 。
两人在此过程中又亲又抱,两个人的亲吻次数超20次,期间二人又是十指相扣,又是摸大腿,动作十分亲昵!网友们大呼看不下去的同时也非常心疼马国明与郑秀文。
随后,当晚的许志安宣布召开记者会,就出轨一事作出解释并在微博发文:这是一件不可能被原谅的错事,我不敢奢求原谅,因为我也没有办法可以原谅我自己。我只可以深切反省,并以最诚恳的态度,去为所有因为这件事而受影响的人,去说一声,我真的做错了,难辞其咎,对不起!
在记者会上,许志安被问及是否得到了太太郑秀文的原谅了的时候,许志安一言不发,也没有回应他与黄心颖二人保持这段关系是不是已经长达二年。许志安再怎么诚恳的道歉也无法弥补对郑秀文和马国明的伤害。
在这个事件之前,说起许志安与马国明这两人的关系,其实他们一早就已经认识的,他们同是明星足球队的成员,马国明在早期的时候还帮许志安拍过《昨迟人》MV。
而《昨迟人》歌词中的“谁与你竟早潜逃终于徒劳”、“这恋爱的旅途,我想要得到却未拾到,多么糟可给我为你填补”、“昨日像得到迟来无去路,给你与某人在长夜共抱”、“我会祝福你安好,快乐投入那些怀抱”。

再回看起这个MV,真是满满的讽刺,简直就是唱出了马国明的此时心声,不知道马国明回看这个MV时,心里会有什么感受,心疼马国明!
而郑秀文与黄心颖两人经常玩在一起,两个人亲如姐妹。如今因为许志安出轨事件的爆出,媒体挖出了在去年年底郑秀文晒出与黄心颖一起在健身房运动的动态。动态中可以看出两个人的关系很亲密,有说有笑,郑秀文还亲密的称呼黄心颖为心颖BB。
郑秀文这样在个人的社交账号上分享两个人的日常生活,足以见得两个人的关系是相当不错的,而如今黄心颖却出轨了自己老公许志安,这难道就是网络上很火的一句话:防火防盗防闺蜜?
据了解,黄心颖与许志安两人在2018年的时候同台合唱过,两个人深情对唱。在2019年的时候,两个人见面的次数也多了,节日、黄心颖生日的时候都有见面。黄心颖和许志安两个人可谓是明目张胆在见面。
相信此次出轨事件对郑秀文的打击很大,至于郑秀文会不会原谅许志安,还是得看许志安的态度有多诚恳。不过粉丝们表示无论郑秀 *** 什么决定,他们都会支持她的!
版权声明:免责声明:本文来源网友投稿及网络整合仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。投诉邮箱:1765130767@qq.com.