MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / pattern_match

Function pattern_match

lm-eval-harness/lm_eval/utils.py:101–109  ·  view source on GitHub ↗
(patterns, source_list)

Source from the content-addressed store, hash-verified

99# Returns a list containing all values of the source_list that
100# match at least one of the patterns
101def pattern_match(patterns, source_list):
102 if isinstance(patterns, str):
103 patterns = [patterns]
104
105 task_names = set()
106 for pattern in patterns:
107 for matching in fnmatch.filter(source_list, pattern):
108 task_names.add(matching)
109 return sorted(list(task_names))
110
111
112def general_detokenize(string):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected