MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / pattern_match

Function pattern_match

test/general/lm_eval/utils.py:114–122  ·  view source on GitHub ↗
(patterns, source_list)

Source from the content-addressed store, hash-verified

112# Returns a list containing all values of the source_list that
113# match at least one of the patterns
114def pattern_match(patterns, source_list):
115 task_names = set()
116 for pattern in patterns:
117 if _is_json_task(pattern):
118 task_names.add(pattern)
119
120 for matching in fnmatch.filter(source_list, pattern):
121 task_names.add(matching)
122 return sorted(list(task_names))
123
124
125def general_detokenize(string):

Callers

nothing calls this directly

Calls 1

_is_json_taskFunction · 0.85

Tested by

no test coverage detected