python
根据表格生成JAVA实体类
在线执行python:https://www.w3cschool.cn/tryrun/runcode?lang=python3
text = """
showIdList List<Long> 查询节目ID列表 否
videoIdList List<Long> 查询视频ID列表 否
"""
import re
print(re.sub(r'([^\s]+)\s+([^\s]+)\s+([^\s]+).*\n', r'/**\3*/private \2 \1;\n', text))
WSGI:https://zhuanlan.zhihu.com/p/269456318
Gunicorn:https://blog.csdn.net/qq_44866828/article/details/141505545
解决服务端大量CLOSED_WAITED:gunicorn model_server:app -b 0.0.0.0:8000 -w ${WORKER_NUMBER} -k uvicorn.workers.UvicornH11Worker --timeout 600 --daemon
剩下的我就加了slowapi限流(不确定效果有多少)
fastApi:https://www.w3ccoo.com/fastapi/fastapi_uvicorn.html#google_vignette
文件锁:FileLock
pystack remote pid
操作图片音视频:http://www.cppcns.com/jiaoben/python/316306.html
Counter:https://zhuanlan.zhihu.com/p/592699102?utm_id=0
https://blog.csdn.net/qq_44879989/article/details/130157229
https://zhuanlan.zhihu.com/p/355601478
一些函数:https://www.cnblogs.com/strongmore/p/13499096.html
python类和JSON转化:https://zhuanlan.zhihu.com/p/654316421
抽象类:https://blog.csdn.net/weixin_36670529/article/details/109246353
MD5:https://blog.51cto.com/u_16213438/7188443?u_atoken=6af5d6ca-7c21-44ac-9684-d1c93a7f8552&u_asession=01LXylAwZRaun9RyNobg1yBLjtMjOP5SjUtMhVUjmgNb5H_dgV9_-HJD4LDdGyKxAt01V224rbO4H4F1NswjBmUNsq8AL43dpOnCClYrgFm6o&u_asig=05uXtM5SkFwRo66gie9QH0jfgHlogPJLDLvgSNiTfbwhjR1OmPEpthCwvLqamNiMoLxGokn2U6nBa1c5mOsvXJUC_5SCC_Juj5Hzqp4wVwnXAELBjdk0wdnbpbHZfuweWKlK8n3RZok88QKh6W06_xTjaSwgQZ_oOl-n-c2zMjUuh8t575LdP6uIbKi59hHbrmksmHjM0JOodanL5-M1Qs1WawK_Y5SQmY1MqxVrOIkv9LHKJWC8hcKSRiIVU2fda6kBNdnZsJaMxhZ3KwFVyvryNci0O0FmHwN1bU9NGedRDUpLHxH1iRKZmnjAu0Zefw&u_aref=juNYRhdKn1bvbgUheHXDGDyuzDQ%3D
pip三方库列表:https://pypi.org/
国内镜像:https://zhuanlan.zhihu.com/p/57872888
筛选后的结果去github判别使用
字符串形式如“[1,2]”,转为list
import ast
data = []
with open('diarization/record.txt', 'r') as file:
lines = file.readlines()
for line in lines:
if line.startswith('tensor'):
continue
item = ast.literal_eval(line)
data.append(item)
list里寻找离目标值最近的值
if self.vid == 1498896056:
zh_srt = pysrt.open("hjxs.srt")
time_text_dict = {}
time_text_list = []
for line in zh_srt:
time_text_dict[line.start.ordinal] = line.text
time_text_list.append(line.start.ordinal)
def find_closest(lst, target):
closest = min(lst, key=lambda x: abs(x - target))
return closest
for item in spk_file.data_list:
start = find_closest(time_text_list, item.sub_start)
zh_text = time_text_dict[start]
item.raw_clip_text = zh_text
# item.raw_clip_local_path = pl_oss.download_url(item.raw_clip_oss_id, 22460*60)