MCPcopy Create free account
hub / github.com/PRIME-RL/PRIME / match_code

Function match_code

eval/Coding/human_eval/evaluate_human_eval.py:65–82  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

63 return chat
64
65def match_code(s):
66 pattern = r'```python(.*?)```'
67 sol = re.findall(pattern, s, re.DOTALL)
68 if len(sol) > 0:
69 for code_block in reversed(sol):
70 if 'def ' in code_block:
71 return code_block
72 return sol[-1]
73
74 pattern = r'```(.*?)```'
75 sol = re.findall(pattern, s, re.DOTALL)
76 if len(sol) > 0:
77 for code_block in reversed(sol):
78 if 'def ' in code_block:
79 return code_block
80 return sol[-1]
81
82 return s.split('```')[0]
83
84def generate_sample_batch(question_list):
85 llm = LLM(

Callers 1

generate_sample_batchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected