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:
《新世界》田丹的私心,让小朵遇害真相陷入僵局,徐天性命堪忧!文|娱乐不必太认真

由徐兵编剧及执导,孙红雷,张鲁一,尹昉,李纯,胡静,万茜,秦汉,赵峥等人联袂出演的现实题材电视剧《新世界》正在热播中,该剧主要以金海,铁林,徐天三兄弟为主线,讲述了他们在新世界来临之际,所作出的不同选择来反映时代变迁的洪流中,小人物们所经历的悲欢离合。

在《新世界》的最新剧情中,随着沈世昌(秦汉饰)的上线,剧中关于柳如丝(李纯饰)的身世之谜也终于揭晓。原来柳如丝在北平,之所以能够黑白两道通吃,是因为她的父亲就是华北剿总局的高官沈世昌。怪不得柳如丝当初也能够调动军队来对付金海他们。
不过随着沈世昌的上线和柳如丝身份的曝光,也让我们看清了目前剧中的斗争形势。沈世昌看似是我党争取的和谈人物,但是他也是一个十足的两面派,一面在积极的和我方人员和谈,又一面的派保密局的人来屠杀我方和谈人员。而柳如丝自从遇到冯青波后,也从一个女强人,慢慢的变成了为情所困的小女人。只有冯青波还依然坚持着自己的信仰。
所以就在我方大军压境后,沈世昌即使有了真心的和谈意愿后,冯青波肯定会成为田丹和沈世昌这次和谈的阻力。不过冯青波虽然会从中阻扰,但是在未来,徐天和金海也都会在背后支持并帮助田丹的。因为未来田丹和沈世昌和谈过程虽然艰辛,但是我们最起码看到了斗争的放下。可是在剧中一开始就埋下的小朵遇害案,在经历了这么多剧集后,就在真相快要大白时,却因为田丹的私心,使得这件事再次陷入了僵局。为何这样说呢?
自从徐天刚接触田丹时,金海就提醒过徐天,不要再找田丹了,不然会被她利用的。但是徐天就是不听,一直让身在狱中的田丹,帮他寻找真凶。田丹在刚开始,通过徐天给的照片,简单的分析出凶手的特征后,她马上就张口让徐天帮她办事了。也正是因为田丹接下来让徐天办的这两件事,使得小朵遇害的真相陷入了僵局。到底是那两件事呢?
第一件事就是田丹让徐天调查冯青波。自从田丹来到京师监狱后,她和铁林的几次接触,基本上判断出了,冯青波是内奸的事实。于是田丹为了证明自己的猜测,就让徐天去调查,冯青波是否还住在庆丰公寓。要知道田丹这招非常蠢。徐天只是一个小警察,让他去调查一个大特工,这不是在搞笑吗?所以到最后,徐天虽然得知了冯青波还住在庆丰公寓,但是冯青波从此也注意上了徐天,并派铁林监视他。
第二件事就是田丹让徐天去拍田怀中伤口这件事。田怀中身上的伤口,是田丹确认冯青波是内奸的直接证据,所以当徐天大张旗鼓地带着周老板去拍田怀中的伤口后,这件事肯定会很快就被冯青波知道。因此以冯青波的性格,想要阻止田丹看到田怀中伤口的照片,他肯定会趁照片没有洗出来之前,就直接干掉周老板的。
如果周老板被冯青波干掉后,那么徐天之前干的所有工作都白费了。因为在周老师身上,很明显已经出现了很多符合小红袄的特征,如今他突然死去,这意味着线索全都断了。所以小朵遇害真相也要陷入僵局了,这些都是因为田丹不明形势,只因自己的一点私心,让徐天去干着他不可能完成的事。
当然,周老板死去,虽然能暂时阻止田丹看到田怀中的伤口,但是田丹一定不会就此放弃,她一定会督促徐天,去想别的办法来拍照片。到时候冯青波如果想要彻底阻止田丹看到照片,他最有效的办法就是直接除掉徐天。因此徐天自从决定帮田丹做事后,他的生命已经堪忧了。对此,不知道您有什么看法呢?
版权声明:免责声明:本文来源网友投稿及网络整合仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。投诉邮箱:1765130767@qq.com.