Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Mercury7353/PyBench
/ functions
Functions
207 in github.com/Mercury7353/PyBench
⨍
Functions
207
◇
Types & classes
34
↓ 7 callers
Function
load_and_validate_pkl
(file_path)
data/unit_test/tests.py:441
↓ 5 callers
Function
are_two_images_same
比较两张图片的相似程度是否超过给定阈值。 参数: img1: PIL.Image.Image - 第一张图片 img2: PIL.Image.Image - 第二张图片 threshold: float - 相似度阈值,默认是0.9(即90%)
data/unit_test/tests.py:71
↓ 4 callers
Function
calculate_sharpness
(image_path)
data/unit_test/tests.py:146
↓ 4 callers
Method
update
(self, usage: Dict[str, int])
llms/api_key_pool.py:146
↓ 3 callers
Method
__init__
(self, client_args: ClientArgs)
llms/api_key_pool.py:165
↓ 2 callers
Method
_remove_cur_arg
(self)
llms/api_key_pool.py:199
↓ 2 callers
Function
calculate_dbfs
(audio_array)
data/unit_test/tests.py:1413
↓ 2 callers
Function
fc2dict
(sequence: str, spliter="<|tool_call|>")
utils/output_parser.py:97
↓ 2 callers
Function
find_fuzzy_file
(file_name, row_idx)
utils/extract_raw_data.py:6
↓ 2 callers
Function
generate_notebook
(cells)
utils/save_notebook.py:4
↓ 2 callers
Function
get_mp3_duration
(file_path)
data/unit_test/tests.py:1465
↓ 2 callers
Function
identify_numeric_columns
(df)
data/unit_test/tests.py:135
↓ 2 callers
Function
is_proportionally_similar
比较两张图片的尺寸比例是否在允许的误差范围内。
data/unit_test/tests.py:114
↓ 2 callers
Function
judge_quota_exceeded
(message: str)
llms/api_key_pool.py:301
↓ 2 callers
Function
read_jsonl
(filename)
utils/calculate_avg_step.py:35
↓ 2 callers
Function
read_mp3_file
(file_path)
data/unit_test/tests.py:1446
↓ 2 callers
Function
read_wave_file
(file_path)
data/unit_test/tests.py:1396
↓ 2 callers
Function
save_as_ipynb
(cells, filename)
utils/save_notebook.py:36
↓ 1 callers
Method
__lt__
Compare two resources based on request rate, token usage and price Args: other (Resource): The other resource to compare with
llms/api_key_pool.py:110
↓ 1 callers
Method
_enforce_trailing_slash
(self, url: str)
llms/api_key_pool.py:141
↓ 1 callers
Method
_post_request
(self, kwargs: Dict[str, Any])
llms/openai_api.py:53
↓ 1 callers
Function
build_llm
build llm from config Args: llm_type (str): llm type, only support openai config (Dict[str, Any]): the dict of llm config R
llms/__init__.py:9
↓ 1 callers
Method
chat
(self,messages)
utils/LlamaCompletions.py:19
↓ 1 callers
Function
check_content
根据task_id匹配并运行相应的单元测试函数。
data/unit_test/enter_point.py:7
↓ 1 callers
Function
count_elements_in_intervals
(elements)
utils/calculate_avg_step.py:47
↓ 1 callers
Function
execute_code
(code_str: str, Kernel, nb)
inference.py:24
↓ 1 callers
Function
extract_code
extract code from assistant content Args: rsp (str): the response content from assistant code_start_token (str, optional): the to
utils/output_parser.py:40
↓ 1 callers
Method
format_message
(self,messages)
utils/LlamaCompletions.py:42
↓ 1 callers
Method
generate
接受用户传入的messages和tools[可选],返回新的message和debug_info Args: messages: chatml messages tools = openai tools description
llms/base_llm.py:14
↓ 1 callers
Function
generate_notebook_one_cell
(role, text=None, code=None, result=None)
utils/save_notebook.py:17
↓ 1 callers
Method
get_client_args
(self)
llms/openai_api.py:22
↓ 1 callers
Function
is_grayscale
检查图像是否是灰度图。
data/unit_test/tests.py:1144
↓ 1 callers
Function
message2dict
( message: Message, )
llms/utils.py:47
↓ 1 callers
Function
parse_code_action
parse output from code interpreter Args: output (str): the output from code interpreter mode: the mode of the output, could be pr
utils/output_parser.py:7
↓ 1 callers
Function
property2dict
把传入的ToolProperty转换为OpenAI接口需要的dict格式 Args: property (ToolProperty): ToolProperty对话 Returns: Dict: 参数的dict形式描述
llms/utils.py:6
↓ 1 callers
Function
read_lines
(lines)
utils/calculate_avg_step.py:13
↓ 1 callers
Function
statistic_info
(compare_path, solution_path)
utils/calculate_avg_step.py:69
↓ 1 callers
Function
tool2dict
(tool: Tool)
llms/utils.py:31
Method
__enter__
Get a client from the pool and return it as a context manager.
llms/api_key_pool.py:190
Method
__enter__
Get a client from the pool and return it as a context manager.
llms/api_key_pool.py:213
Method
__enter__
Get a client from the pool and return it as a context manager.
llms/api_key_pool.py:246
Method
__enter__
Get a client from the pool and return it as a context manager.
llms/api_key_pool.py:275
Method
__exit__
Put the resource back in the pool.
llms/api_key_pool.py:195
Method
__exit__
Put the resource back in the pool.
llms/api_key_pool.py:223
Method
__exit__
Put the resource back in the pool.
llms/api_key_pool.py:255
Method
__exit__
Put the resource back in the pool.
llms/api_key_pool.py:283
Method
__gt__
Compare two resources based on request rate and token usage Args: other (Resource): The other resource to compare with Ret
llms/api_key_pool.py:131
Method
__init__
(self)
utils/LlamaCompletions.py:6
Method
__init__
(self, llm_config: LLMConfig)
llms/base_llm.py:10
Method
__init__
( self, api_key: str, base_url: str, organization: Optional[str] = None,
llms/api_key_pool.py:83
Method
__init__
(self, client_args: ClientArgs)
llms/api_key_pool.py:207
Method
__init__
(self, client_args: ClientArgs)
llms/api_key_pool.py:241
Method
__init__
(self, client_args: ClientArgs)
llms/api_key_pool.py:271
Method
__init__
(self, config: LLMConfig)
llms/openai_api.py:18
Method
__len__
(self)
llms/api_key_pool.py:186
Function
are_images_similar
判断两张图片是否相似,使用ORB特征匹配。 :param image_path1: 第一张图片的文件路径 :param image_path2: 第二张图片的文件路径 :param threshold: 匹配特征点的阈值,默认为0.75 :return:
data/unit_test/tests.py:26
Function
check_file
根据task_id,判断是否需要输出文件, 如果需要,则检测输出文件是否在output文件夹内,模糊匹配,返回匹配的文件名称 如果没有输出文件,则直接failed 如果不需要,这一环节直接pass 好像不是很必要
data/unit_test/tests.py:3
Function
convert_function_call_to_json
(string)
utils/output_parser.py:74
Function
count_tokens
(text)
utils/calculate_avg_step.py:26
Function
extract_code_from_arguments
(arguments_str)
utils/output_parser.py:90
Method
generate
( self, messages: List[Union[Message, Dict]], tools: Optional[List[Union[Tool, Dict]]]
llms/openai_api.py:25
Function
main
(config_path: str, task_path: str, output_path: str)
inference.py:166
Function
process_task
(task, config, llm, system_prompt_template, max_turns, output_path, processed_ids)
inference.py:73
Function
save_jsonl
(data, filename)
utils/calculate_avg_step.py:42
Function
test_task_10
(trajectory)
data/unit_test/tests.py:247
Function
test_task_100
(trajectory)
data/unit_test/tests.py:1151
Function
test_task_101
(trajectory)
data/unit_test/tests.py:1162
Function
test_task_102
(trajectory)
data/unit_test/tests.py:1190
Function
test_task_103
(trajectory)
data/unit_test/tests.py:1219
Function
test_task_105
(trajectory)
data/unit_test/tests.py:1223
Function
test_task_107
(trajectory)
data/unit_test/tests.py:1227
Function
test_task_109
(trajectory)
data/unit_test/tests.py:1232
Function
test_task_11
(trajectory)
data/unit_test/tests.py:252
Function
test_task_110
(trajectory)
data/unit_test/tests.py:1237
Function
test_task_111
(trajectory)
data/unit_test/tests.py:1242
Function
test_task_112
(trajectory)
data/unit_test/tests.py:1247
Function
test_task_113
(trajectory)
data/unit_test/tests.py:1252
Function
test_task_114
(trajectory)
data/unit_test/tests.py:1257
Function
test_task_115
(trajectory)
data/unit_test/tests.py:1262
Function
test_task_116
(trajectory)
data/unit_test/tests.py:1267
Function
test_task_117
(trajectory)
data/unit_test/tests.py:1272
Function
test_task_118
(trajectory)
data/unit_test/tests.py:1277
Function
test_task_119
(trajectory)
data/unit_test/tests.py:1281
Function
test_task_12
(trajectory)
data/unit_test/tests.py:261
Function
test_task_120
(trajectory)
data/unit_test/tests.py:1285
Function
test_task_121
(trajectory)
data/unit_test/tests.py:1289
Function
test_task_122
(trajectory)
data/unit_test/tests.py:1293
Function
test_task_123
(trajectory)
data/unit_test/tests.py:1297
Function
test_task_124
(trajectory)
data/unit_test/tests.py:1301
Function
test_task_126
(trajectory)
data/unit_test/tests.py:1305
Function
test_task_128
(trajectory)
data/unit_test/tests.py:1309
Function
test_task_129
(trajectory)
data/unit_test/tests.py:1313
Function
test_task_13
(trajectory)
data/unit_test/tests.py:266
Function
test_task_130
(trajectory)
data/unit_test/tests.py:1317
Function
test_task_131
(trajectory)
data/unit_test/tests.py:1321
Function
test_task_132
(trajectory)
data/unit_test/tests.py:1326
Function
test_task_133
(trajectory)
data/unit_test/tests.py:1330
Function
test_task_134
(trajectory)
data/unit_test/tests.py:1334
Function
test_task_135
(trajectory)
data/unit_test/tests.py:1339
Function
test_task_136
(trajectory)
data/unit_test/tests.py:1343
next →
1–100 of 207, ranked by callers