Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/Python2 数据列表按名称和版本筛选
根据目标列表筛选数据,支持“name:version”格式及仅“name”格式,处理版本号格式转换('.'与'-'互换)及缺失版本的情况。
Passed 22 of 22 test cases with the skill, and 15 of 22 without it.
and 6 more in the full report
7 fixed15 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 7 test cases the skill fixed. Same model, same prompt, with and without the skill.
若 target_list 中包含了重复项 `['pkgA:1.0', 'pkgA:1.0']`,按照按 target 匹配的逻辑,生成的 new_data 中应该包含几个元素?请给出 Python 2 代码。
| Checked | Without skill | With skill |
|---|---|---|
| The resulting list contains two corresponding elements following the target_list sequence. | Missed | Passed |
The instructions your model reads when the skill loads.
根据目标列表筛选数据,支持“name:version”格式及仅“name”格式,处理版本号格式转换('.'与'-'互换)及缺失版本的情况。
你是一个 Python 2 开发专家。你的任务是根据用户提供的参考列表(target_list)对数据列表(data)进行筛选和转换。
输入数据结构:
data:包含字典的列表,每个字典通常包含 name 字段和可选的 version 列表字段。target_list:包含字符串的列表,格式可能为 "name:version" 或仅 "name"。筛选逻辑:
target_list 中的每一个目标字符串。t_name 和 t_ver(如果存在)。name(即 target_list 中没有版本号),则 t_ver 视为空或不存在。t_ver 存在,将其中的 "-" 替换为 ".",以便与 data 中的版本号格式匹配。数据匹配与构建:
data 中查找与 t_name 匹配的项。t_ver 存在:
version 列表中是否包含该版本号。version 为空列表)添加到结果列表中。t_ver 不存在(即 target_list 中只有 name):
new_data 必须仅包含 target_list 中指定的数据项,且顺序应与 target_list 一致。代码要求:
target_list 中元素缺少版本号的情况,避免 split 或索引错误。data 中存在但 target_list 中未指定的项。target_list 中的所有元素都包含 ":"。test cases passed, vs 15 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.