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:
一、自制三明治简单做法?
优质答案1:
用料
全麦面包切片 六片
盐水火腿 六片
鸡蛋 两个
生菜 四片
沙拉酱 适量
食用油 一勺
做法步骤
1、三明治应该是最简单的早点了,只需要煎蛋,然后把食材叠加就可以了
2、煎蛋煎好了
3、沙拉酱是自己做的,用玉米油或者色拉油、柠檬、盐、糖打发乳化,特别好吃
优质答案2:
1、把一片面包放到三明治机里,面包上放一片奶酪片;
2、再切一片番茄片放到奶酪片上;
3、放上一个煎熟的鸡蛋,再挤上一些番茄酱;
4、再铺上一片面包片;
5、合上三明治机上盖,加热3分钟左右;
6、打开后取出烤好的三明治,取出食用,或者对切成两半食用。
优质答案3:
用料
吐司 2片
火腿 4片
鸡蛋 1个
生菜 3片
胡椒粉 2克
沙拉酱 4勺
自制三明治(零失败)的做法步骤
步骤 1
准备好食材:火腿、鸡蛋、生菜、沙拉酱、胡椒粉、玉米粒适量
步骤 2
将鸡蛋和玉米粒加适量沙拉酱及胡椒粉,炒2~3分钟
步骤 3
炒好的鸡蛋酱
步骤4
吐司准备,将鸡蛋酱涂在吐司上,再加4小片火腿,再铺生菜,然后挤上沙拉酱。
步骤 5
将三明治用保鲜膜封起来,封3~4个小时
步骤 6
用到切开,一个简单又零失败的家常三明治就完成了!
二、最简单的奶酪片做三明治的做法?
首先面包店买来切片面包,超市买来包奶酪片,买一根粗火腿,把它切稍微厚点的片状,然后锅里放点黄油,分别煎一下火腿和荷包蛋,然后面包片上放一层奶酪片,一片生菜,一片火腿和一个荷包蛋,在涂点番茄酱,最后该一片切片面包
三、各种三明治的做法?
优质答案1:
1. 三明治是一种简单易 *** 的美食,有很多不同的做法。
2. 最简单的三明治做法是将两片吐司面包放在一起,中间夹一些蔬菜和肉类,再加上调味品如蛋黄酱或芥末酱即可。
3. 其他常见的三明治类型包括火腿三明治、培根三明治、鸡肉三明治、芝士三明治、鸡蛋蔬菜三明治等。
可以根据自己的口味偏好选择不同的食材来 *** 。
4. 除了传统的面包三明治,还可以将馅料加在卷饼或饼干上 *** 三明治。
这些款式的三明治在便携性和方便性上都有所提高。
5. 总之,三明治可以说是一种非常灵活的美食, *** 上有很多不同的 *** 和变化,可以根据自己的口味和偏好来进行创新和探索。
优质答案2:
懒人三明治
1、准备食材:鸡蛋液、火腿片、生菜、西红柿片、肉松、沙拉酱、吐司片、黑芝麻2、步骤:
(1)平底锅刷油预热倒入蛋液,放入两片吐司翻面,再撒上黑芝麻
(2)煎凝固后翻面,在一片吐司铺上生菜、西红柿片、火腿片、沙拉酱和肉松
(3)在煎凝固上色,将鸡蛋饼向里叠起来,再将两片吐司叠起来,包裹上保鲜膜固定,切开就可以吃啦,简单又营养孩子爱吃✅
四、面包的做法是什么?
优质答案1:
这款纯手工面包营养丰富,味浓醇香,让你口水直流,一看就会! *** 很简单
优质答案2:
你好,我是奥斯卡炊事班老汪,我的回答希望可以帮到你。
工具原料
面粉、鸡蛋蒸锅
***
1.取出两碗面粉,在大碗中打6颗鸡蛋,把6个蛋黄舀入面粉中。
2.剩下的蛋清中加5克酵母粉,5克盐,两勺白糖,适量橄榄油搅拌均匀。
3.先用蛋清和面,如果面和蛋清不能充分混合,也就是说蛋清少,面粉多的时候也可以加适量牛奶搅拌均匀,下手揉成光滑的面团,加保鲜膜醒发至两倍大。
4.将醒发好的面团做成6个大小均匀的面团放入盆中,事先在盆中刷上一层油以防粘连。今天的面剩的多再做一个小点的吧,这时候要特别注意了,也是最关键的一步,在做好的面肧上抹上一层蛋黄液,撒上芝麻,加保鲜膜二次醒发。
5.醒发至两倍大后就可以上蒸锅了,值得注意的是蒸锅里的水尽量加的多一点,不过也不要太多,一般蒸45分钟到一个小时就可以了,这要看面胚的大小。为了保熟起见,我蒸了一个小时。蒸的时候不要去下保鲜膜。


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